beanManager.getWebBeansContext().getBeanArchiveService().getBeanArchiveInformation(beanArchiveUrl);
foundClasses = CdiArchive.FoundClasses.class.cast( CdiArchive.FoundClasses.class.getConstructor(CdiArchive.class, URL.class, Collection.class, BeanArchiveService.BeanArchiveInformation.class) .newInstance(null, url, new HashSet<>(), beanArchiveService.getBeanArchiveInformation(url))); archive.classesByUrl().put(key, foundClasses);
foundClasses = CdiArchive.FoundClasses.class.cast( CdiArchive.FoundClasses.class.getConstructor(CdiArchive.class, URL.class, Collection.class, BeanArchiveService.BeanArchiveInformation.class) .newInstance(null, url, new HashSet<>(), beanArchiveService.getBeanArchiveInformation(url))); archive.classesByUrl().put(key, foundClasses);
protected void doAddWebBeansXmlLocation(URL beanArchiveUrl) { beanArchiveLocations.add(beanArchiveUrl); // and also scan the bean archive! if (beanArchiveService == null) { beanArchiveService = webBeansContext().getBeanArchiveService(); } // just to trigger the creation beanArchiveService.getBeanArchiveInformation(beanArchiveUrl); }
public CdiArchive(BeanArchiveService beanArchiveService, ClassLoader loader, Map<String, URL> urls, Filter userFilter, Archive customArchive) { Collection<Archive> archives = new ArrayList<>(); boolean customAdded = false; for (URL url : urls.values()) { List<String> urlClasses = new ArrayList<>(); BeanArchiveInformation beanArchiveInfo = beanArchiveService.getBeanArchiveInformation(url); final boolean custom = "openwebbeans".equals(url.getProtocol()); Archive archive = new FilteredArchive( custom ? customArchive : ClasspathArchive.archive(loader, url), new BeanArchiveFilter(beanArchiveInfo, urlClasses, userFilter)); if (!customAdded && custom) { customAdded = true; } classesByUrl.put(url.toExternalForm(), new FoundClasses(url, urlClasses, beanArchiveInfo)); archives.add(archive); } if (!customAdded && customArchive != null) { archives.add(userFilter != null ? new FilteredArchive(customArchive, userFilter) : customArchive); } delegate = new CompositeArchive(archives); }
/** * Discovers and deploys alternatives, interceptors and decorators from XML. * * @param scanner discovery scanner * * @throws WebBeansDeploymentException if a problem occurs */ protected void deployFromXML(ScannerService scanner) throws WebBeansDeploymentException { logger.fine("Deploying configurations from XML files has started."); Set<URL> bdaLocations = scanner.getBeanXmls(); Iterator<URL> it = bdaLocations.iterator(); while (it.hasNext()) { URL url = it.next(); logger.fine("OpenWebBeans BeansDeployer configuring: " + url.toExternalForm()); BeanArchiveInformation beanArchiveInformation = beanArchiveService.getBeanArchiveInformation(url); configureDecorators(url, beanArchiveInformation.getDecorators()); configureInterceptors(url, beanArchiveInformation.getInterceptors()); configureAlternatives(url, beanArchiveInformation.getAlternativeClasses(), false); configureAlternatives(url, beanArchiveInformation.getAlternativeStereotypes(), true); configureAllowProxying(url, beanArchiveInformation.getAllowProxyingClasses()); } logger.fine("Deploying configurations from XML has ended successfully."); }
private void scanJarArchive(Archive<?> archive) { URL beansXmlUrl = getBeanXmlUrl(archive, "META-INF/beans.xml"); if (beansXmlUrl == null) { // that means we switch to 'Implicit BDA' mode beansXmlUrl = getBeanXmlUrl(archive, "/"); } // otherwise we store it for later use beansXmls.add(beansXmlUrl); // and now scan all classes those classes acording to their BDA info Map<ArchivePath, Node> classes = archive.getContent(Filters.include(".*\\.class")); scanClasses(beanArchiveService.getBeanArchiveInformation(beansXmlUrl), classes, null); }
information = beanArchiveService.getBeanArchiveInformation(bda.uri.toURL()); } catch (final MalformedURLException e) { throw new IllegalStateException(e);
BeanArchiveService.BeanArchiveInformation info = beanArchiveService.getBeanArchiveInformation(webBeansXmlUrl != null ? webBeansXmlUrl : metainfBeansXmlUrl);