Class AbstractMetaDataDiscovery

    • Field Detail

      • logger

        protected static final Logger logger
      • scanningExcludes

        protected String[] scanningExcludes
      • isBDAScannerEnabled

        protected boolean isBDAScannerEnabled
      • bdaBeansXmlScanner

        protected org.apache.webbeans.spi.BDABeansXmlScanner bdaBeansXmlScanner
    • Constructor Detail

      • AbstractMetaDataDiscovery

        public AbstractMetaDataDiscovery()
    • Method Detail

      • initFinder

        protected org.apache.xbean.finder.AnnotationFinder initFinder()
      • getAdditionalArchive

        protected org.apache.xbean.finder.archive.Archive getAdditionalArchive()
      • getBeanArchiveUrls

        protected Iterable<URL> getBeanArchiveUrls()
        Deprecated.
        just here for backward compat reasons
        Returns:
        list of beans.xml locations or implicit bean archives
      • getBeanDeploymentUrls

        public Map<String,​URL> getBeanDeploymentUrls()
        Returns:
        URLs of all classpath entries which
      • configure

        protected abstract void configure()
      • registerBeanArchives

        protected void registerBeanArchives​(ClassLoader loader)
        Since CDI-1.1 this is actually more a 'findBdaBases' as it also picks up jars without marker file. This will register all 'explicit' Bean Archives, aka all META-INF/beans.xml resources on the classpath. Those will be added including the META-INF/beans.xml in the URL. We will also add all other classpath locations which do not have the beans.xml marker file, the 'implicit bean archives'. In this case the URL will point to the root of the classpath entry.
        Parameters:
        loader - the ClassLoader which should be used
        See Also:
        getBeanArchiveUrls(), getBeanDeploymentUrls()
      • stripProtocol

        protected String stripProtocol​(String urlPath)
        Get rid of any protocol header from the url externalForm
        Parameters:
        urlPath -
      • filterExcludedJars

        protected void filterExcludedJars​(Set<URL> classPathUrls)
      • isExcludedJar

        protected boolean isExcludedJar​(URL url)
      • isExcludedJar

        protected int isExcludedJar​(String path)
      • release

        public void release()
        Specified by:
        release in interface org.apache.webbeans.spi.ScannerService
      • addDeploymentUrl

        protected void addDeploymentUrl​(String beansXml,
                                        URL cpUrl)
        Add an URL for a deployment later on
        Parameters:
        beansXml -
        cpUrl -
      • isBdaUrlEnabled

        protected boolean isBdaUrlEnabled​(URL bdaUrl)
        This method could filter out known JARs or even JVM classpaths which shall not be considered bean archives.
        Returns:
        whether the URL is a bean archive or not
      • init

        public void init​(Object object)
        Specified by:
        init in interface org.apache.webbeans.spi.ScannerService
      • initScanningExcludes

        public void initScanningExcludes()
      • addWebBeansXmlLocation

        protected void addWebBeansXmlLocation​(URL beanArchiveUrl)
        add the given beans.xml path to the locations list
        Parameters:
        beanArchiveUrl - location path
      • doAddWebBeansXmlLocation

        protected void doAddWebBeansXmlLocation​(URL beanArchiveUrl)
      • getBeanClassesPerBda

        public Map<org.apache.webbeans.spi.BeanArchiveService.BeanArchiveInformation,​Set<Class<?>>> getBeanClassesPerBda()
        This method only gets called if the initialisation is done already. It will collect all the classes from all the BDAs it can find.
        Specified by:
        getBeanClassesPerBda in interface org.apache.webbeans.spi.BdaScannerService
      • getBeanClasses

        public Set<Class<?>> getBeanClasses()
        Specified by:
        getBeanClasses in interface org.apache.webbeans.spi.ScannerService
      • isBeanAnnotatedClass

        protected boolean isBeanAnnotatedClass​(org.apache.xbean.finder.AnnotationFinder.ClassInfo classInfo)
        This method is called for classes from bean archives with bean-discovery-mode 'annotated'. This method is intended to be overwritten in integration scenarios and e.g. allows to add other criterias for keeping the class.
        Parameters:
        classInfo -
        Returns:
        true if this class should be kept and further get picked up as CDI Bean
      • isBeanAnnotation

        protected boolean isBeanAnnotation​(org.apache.xbean.finder.AnnotationFinder.AnnotationInfo annotationInfo)
      • getBeanXmls

        public Set<URL> getBeanXmls()
        Specified by:
        getBeanXmls in interface org.apache.webbeans.spi.ScannerService
      • getBDABeansXmlScanner

        public org.apache.webbeans.spi.BDABeansXmlScanner getBDABeansXmlScanner()
        Specified by:
        getBDABeansXmlScanner in interface org.apache.webbeans.spi.ScannerService
      • isBDABeansXmlScanningEnabled

        public boolean isBDABeansXmlScanningEnabled()
        Specified by:
        isBDABeansXmlScanningEnabled in interface org.apache.webbeans.spi.ScannerService