beanManager.getWebBeansContext().getBeanArchiveService().getBeanArchiveInformation(beanArchiveUrl); if (!beanArchiveInfo.isClassExcluded(beanClass.getName())) {
for (final BeansInfo.BDAInfo bda : beans.bdas) { final BeanArchiveService.BeanArchiveInformation info = infoByBda.get(bda); if (info.getBeanDiscoveryMode() == BeanArchiveService.BeanDiscoveryMode.NONE) { continue;
beanClassesPerBda.put(info, bdaClasses); if (info != null && info.getBeanDiscoveryMode() == BeanArchiveService.BeanDiscoveryMode.NONE) if (info != null && info.isClassExcluded(className)) if (info != null && info.getBeanDiscoveryMode() == BeanArchiveService.BeanDiscoveryMode.ANNOTATED)
addClasses(information.getAlternativeClasses(), classLoader); addClasses(information.getDecorators(), classLoader); addClasses(information.getInterceptors(), classLoader); addClasses(information.getAlternativeStereotypes(), classLoader); final boolean scanModeAnnotated = BeanArchiveService.BeanDiscoveryMode.ANNOTATED.equals(information.getBeanDiscoveryMode()); final boolean noScan = BeanArchiveService.BeanDiscoveryMode.NONE.equals(information.getBeanDiscoveryMode()); final boolean isNotEarWebApp = startupObject.getWebContext() == null; if (information.isClassExcluded(name)) { continue;
List<AnnotatedType<?>> annotatedTypes = atEntry.getValue(); boolean onlyScopedBeans = BeanDiscoveryMode.TRIM == bdaInfo.getBeanDiscoveryMode();
boolean scanModeAnnotated = BeanDiscoveryMode.ANNOTATED == foundClasses.getBeanArchiveInfo().getBeanDiscoveryMode(); for (String className : foundClasses.getClassNames())
/** * 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."); }
DefaultBeanArchiveInformation mergedBdaInfo = new DefaultBeanArchiveInformation(bdaWebClasses.getBdaUrl()); mergedBdaInfo.setBeanDiscoveryMode(BeanDiscoveryMode.max(bdaWebClasses.getBeanDiscoveryMode(), bdaWebInf.getBeanDiscoveryMode())); mergedBdaInfo.setVersion(bdaWebClasses.getVersion() != null ? bdaWebClasses.getVersion() : bdaWebInf.getVersion()); mergedBdaInfo.setExcludedClasses(mergeLists(bdaWebClasses.getExcludedClasses(), bdaWebInf.getExcludedClasses())); mergedBdaInfo.setExcludedPackages(mergeLists(bdaWebClasses.getExcludedPackages(), bdaWebInf.getExcludedPackages())); mergedBdaInfo.setInterceptors(mergeLists(bdaWebClasses.getInterceptors(), bdaWebInf.getInterceptors())); mergedBdaInfo.setDecorators(mergeLists(bdaWebClasses.getDecorators(), bdaWebInf.getDecorators())); mergedBdaInfo.getAlternativeClasses().addAll(mergeLists(bdaWebClasses.getAlternativeClasses(), bdaWebInf.getAlternativeClasses())); mergedBdaInfo.getAlternativeStereotypes().addAll(mergeLists(bdaWebClasses.getAlternativeStereotypes(), bdaWebInf.getAlternativeStereotypes()));
@Override public boolean accept(String name) { if (scanNone) { return false; } if ((userFilter != null && !userFilter.accept(name)) || beanArchiveInfo.isClassExcluded(name)) { return false; } urlClasses.add(name); return true; }
public BeanArchiveFilter(BeanArchiveInformation beanArchiveInfo, List<String> urlClasses, Filter userFilter) { this.beanArchiveInfo = beanArchiveInfo; this.urlClasses = urlClasses; this.userFilter = userFilter; BeanDiscoveryMode discoveryMode = beanArchiveInfo.getBeanDiscoveryMode(); scanNone = BeanDiscoveryMode.NONE == discoveryMode; }