Class AbstractDiscoveryStrategy
java.lang.Object
org.jboss.weld.environment.deployment.discovery.AbstractDiscoveryStrategy
- All Implemented Interfaces:
DiscoveryStrategy
- Direct Known Subclasses:
JandexDiscoveryStrategy,ReflectionDiscoveryStrategy
- Author:
- Matej Briškár, Martin Kouba, Jozef Hartinger, Laird Nelson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.jboss.weld.bootstrap.api.Bootstrapprotected Set<Class<? extends Annotation>>protected org.jboss.weld.resources.spi.ResourceLoaderprotected BeanArchiveScanner -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDiscoveryStrategy(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, org.jboss.weld.bootstrap.api.Bootstrap bootstrap, Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, org.jboss.weld.bootstrap.spi.BeanDiscoveryMode emptyBeansXmlDiscoveryMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToArchives(Set<WeldBeanDeploymentArchive> deploymentArchives, WeldBeanDeploymentArchive bda) protected voidafterDiscovery(Set<WeldBeanDeploymentArchive> archives) protected voidbeforeDiscovery(Collection<BeanArchiveBuilder> builders) Initialize the strategy before accessing found BeanArchiveBuilder builders.org.jboss.weld.resources.spi.ClassFileServicesprotected WeldBeanDeploymentArchiveprocessAllDiscovery(BeanArchiveBuilder builder) Process the bean archive with bean-discovery-mode of all.protected WeldBeanDeploymentArchiveProcess the bean archive with bean-discovery-mode of annotated.protected WeldBeanDeploymentArchiveprocessNoneDiscovery(BeanArchiveBuilder builder) Process the bean archive with bean-discovery-mode of none.voidregisterHandler(BeanArchiveHandler handler) Register additionalBeanArchiveHandlerfor handling discovered bean archives.voidsetBootstrap(org.jboss.weld.bootstrap.api.Bootstrap bootstrap) Installs aBootstrapfor use by the implementation.voidsetInitialBeanDefiningAnnotations(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations) Installs theSetof bean defining annotations that the implementation may use when discovering beans.voidsetResourceLoader(org.jboss.weld.resources.spi.ResourceLoader resourceLoader) Installs aResourceLoaderfor use by the implementation.voidsetScanner(BeanArchiveScanner scanner) Optionally, a client may set a custom scanner implementation.
-
Field Details
-
resourceLoader
protected org.jboss.weld.resources.spi.ResourceLoader resourceLoader -
bootstrap
protected org.jboss.weld.bootstrap.api.Bootstrap bootstrap -
initialBeanDefiningAnnotations
-
scanner
-
-
Constructor Details
-
AbstractDiscoveryStrategy
protected AbstractDiscoveryStrategy() -
AbstractDiscoveryStrategy
public AbstractDiscoveryStrategy(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, org.jboss.weld.bootstrap.api.Bootstrap bootstrap, Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, org.jboss.weld.bootstrap.spi.BeanDiscoveryMode emptyBeansXmlDiscoveryMode) - Parameters:
resourceLoader-bootstrap-initialBeanDefiningAnnotations-emptyBeansXmlDiscoveryMode-
-
-
Method Details
-
setResourceLoader
public void setResourceLoader(org.jboss.weld.resources.spi.ResourceLoader resourceLoader) Description copied from interface:DiscoveryStrategyInstalls aResourceLoaderfor use by the implementation.- Specified by:
setResourceLoaderin interfaceDiscoveryStrategy- Parameters:
resourceLoader- theResourceLoaderto install
-
setBootstrap
public void setBootstrap(org.jboss.weld.bootstrap.api.Bootstrap bootstrap) Description copied from interface:DiscoveryStrategyInstalls aBootstrapfor use by the implementation.- Specified by:
setBootstrapin interfaceDiscoveryStrategy- Parameters:
bootstrap- theBootstrapto install
-
setScanner
Description copied from interface:DiscoveryStrategyOptionally, a client may set a custom scanner implementation. If not set, the impl is allowed to use anything it considers appropriate.- Specified by:
setScannerin interfaceDiscoveryStrategy
-
setInitialBeanDefiningAnnotations
public void setInitialBeanDefiningAnnotations(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations) Description copied from interface:DiscoveryStrategyInstalls theSetof bean defining annotations that the implementation may use when discovering beans.- Specified by:
setInitialBeanDefiningAnnotationsin interfaceDiscoveryStrategy- Parameters:
initialBeanDefiningAnnotations- the initialSetof bean defining annotations
-
performDiscovery
- Specified by:
performDiscoveryin interfaceDiscoveryStrategy- Returns:
- the set of discovered
WeldBeanDeploymentArchives
-
getClassFileServices
public org.jboss.weld.resources.spi.ClassFileServices getClassFileServices()- Specified by:
getClassFileServicesin interfaceDiscoveryStrategy- Returns:
- the associated
ClassFileServicesornull
-
addToArchives
protected void addToArchives(Set<WeldBeanDeploymentArchive> deploymentArchives, WeldBeanDeploymentArchive bda) -
beforeDiscovery
Initialize the strategy before accessing found BeanArchiveBuilder builders. Best used for saving some information before the process method for each builder is called. -
afterDiscovery
-
processNoneDiscovery
Process the bean archive with bean-discovery-mode of none. The archive is ignored by default. -
processAnnotatedDiscovery
Process the bean archive with bean-discovery-mode of annotated. -
processAllDiscovery
Process the bean archive with bean-discovery-mode of all. -
registerHandler
Description copied from interface:DiscoveryStrategyRegister additionalBeanArchiveHandlerfor handling discovered bean archives.- Specified by:
registerHandlerin interfaceDiscoveryStrategy- Parameters:
handler- the handler
-