Class AbstractDiscoveryStrategy
- java.lang.Object
-
- org.jboss.weld.environment.deployment.discovery.AbstractDiscoveryStrategy
-
- All Implemented Interfaces:
DiscoveryStrategy
- Direct Known Subclasses:
JandexDiscoveryStrategy,ReflectionDiscoveryStrategy
public abstract class AbstractDiscoveryStrategy extends Object implements DiscoveryStrategy
- Author:
- Matej Briškár, Martin Kouba, Jozef Hartinger, Laird Nelson
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jboss.weld.bootstrap.api.Bootstrapbootstrapprotected Set<Class<? extends Annotation>>initialBeanDefiningAnnotationsprotected org.jboss.weld.resources.spi.ResourceLoaderresourceLoaderprotected BeanArchiveScannerscanner
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDiscoveryStrategy()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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.ClassFileServicesgetClassFileServices()Set<WeldBeanDeploymentArchive>performDiscovery()protected WeldBeanDeploymentArchiveprocessAllDiscovery(BeanArchiveBuilder builder)Process the bean archive with bean-discovery-mode of all.protected WeldBeanDeploymentArchiveprocessAnnotatedDiscovery(BeanArchiveBuilder builder)Process 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 Detail
-
resourceLoader
protected org.jboss.weld.resources.spi.ResourceLoader resourceLoader
-
bootstrap
protected org.jboss.weld.bootstrap.api.Bootstrap bootstrap
-
initialBeanDefiningAnnotations
protected Set<Class<? extends Annotation>> initialBeanDefiningAnnotations
-
scanner
protected BeanArchiveScanner scanner
-
-
Constructor Detail
-
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 Detail
-
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
public void setScanner(BeanArchiveScanner scanner)
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
public Set<WeldBeanDeploymentArchive> 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
protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders)
Initialize the strategy before accessing found BeanArchiveBuilder builders. Best used for saving some information before the process method for each builder is called.
-
afterDiscovery
protected void afterDiscovery(Set<WeldBeanDeploymentArchive> archives)
-
processNoneDiscovery
protected WeldBeanDeploymentArchive processNoneDiscovery(BeanArchiveBuilder builder)
Process the bean archive with bean-discovery-mode of none. The archive is ignored by default.
-
processAnnotatedDiscovery
protected WeldBeanDeploymentArchive processAnnotatedDiscovery(BeanArchiveBuilder builder)
Process the bean archive with bean-discovery-mode of annotated.
-
processAllDiscovery
protected WeldBeanDeploymentArchive processAllDiscovery(BeanArchiveBuilder builder)
Process the bean archive with bean-discovery-mode of all.
-
registerHandler
public void registerHandler(BeanArchiveHandler handler)
Description copied from interface:DiscoveryStrategyRegister additionalBeanArchiveHandlerfor handling discovered bean archives.- Specified by:
registerHandlerin interfaceDiscoveryStrategy- Parameters:
handler- the handler
-
-