org.apache.webbeans.corespi.scanner
Class AbstractMetaDataDiscovery

java.lang.Object
  extended by org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
All Implemented Interfaces:
ScannerService
Direct Known Subclasses:
DefaultScannerService, OpenWebBeansTestMetaDataDiscoveryService

public abstract class AbstractMetaDataDiscovery
extends Object
implements ScannerService


Field Summary
protected  BDABeansXmlScanner bdaBeansXmlScanner
           
protected  boolean isBDAScannerEnabled
           
protected  WebBeansLogger logger
           
static String META_INF_BEANS_XML
           
 
Constructor Summary
protected AbstractMetaDataDiscovery()
           
 
Method Summary
protected  void addWebBeansXmlLocation(URL beansXmlUrl)
          add the given beans.xml path to the locations list
protected abstract  void configure()
           
protected  void crossReferenceBeans()
          Ensure that all Annotation CrossReferences got resolved.
protected  String[] findBeansXmlBases(String resourceName, ClassLoader loader)
          Find the base paths of all available resources with the given resourceName in the classpath.
 Set<String> getAllAnnotations(String className)
           
protected  AnnotationDB getAnnotationDB()
           
 BDABeansXmlScanner getBDABeansXmlScanner()
           
 Set<Class<?>> getBeanClasses()
           
 Set<URL> getBeanXmls()
           
 void init(Object object)
           
 boolean isBDABeansXmlScanningEnabled()
           
 void release()
           
 void scan()
          Configure the Web Beans Container with deployment information and fills annotation database and beans.xml stream database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final WebBeansLogger logger

META_INF_BEANS_XML

public static final String META_INF_BEANS_XML
See Also:
Constant Field Values

isBDAScannerEnabled

protected boolean isBDAScannerEnabled

bdaBeansXmlScanner

protected BDABeansXmlScanner bdaBeansXmlScanner
Constructor Detail

AbstractMetaDataDiscovery

protected AbstractMetaDataDiscovery()
Method Detail

scan

public void scan()
          throws WebBeansDeploymentException
Configure the Web Beans Container with deployment information and fills annotation database and beans.xml stream database.

Specified by:
scan in interface ScannerService
Throws:
WebBeansConfigurationException - if any run time exception occurs
WebBeansDeploymentException

release

public void release()
Specified by:
release in interface ScannerService

configure

protected abstract void configure()

findBeansXmlBases

protected String[] findBeansXmlBases(String resourceName,
                                     ClassLoader loader)
Find the base paths of all available resources with the given resourceName in the classpath. The returned Strings will NOT contain the resourceName itself!

Parameters:
resourceName - the name of the resource, e.g. 'META-INF/beans.xml'
loader - the ClassLoader which should be used
Returns:
array of Strings with the URL path to the resources.

init

public void init(Object object)
Specified by:
init in interface ScannerService

getAnnotationDB

protected AnnotationDB getAnnotationDB()
Returns:
the aNNOTATION_DB

getAllAnnotations

public Set<String> getAllAnnotations(String className)
Specified by:
getAllAnnotations in interface ScannerService

addWebBeansXmlLocation

protected void addWebBeansXmlLocation(URL beansXmlUrl)
add the given beans.xml path to the locations list

Parameters:
beansXmlUrl - location path

getBeanClasses

public Set<Class<?>> getBeanClasses()
Specified by:
getBeanClasses in interface ScannerService

crossReferenceBeans

protected void crossReferenceBeans()
Ensure that all Annotation CrossReferences got resolved.


getBeanXmls

public Set<URL> getBeanXmls()
Specified by:
getBeanXmls in interface ScannerService

getBDABeansXmlScanner

public BDABeansXmlScanner getBDABeansXmlScanner()
Specified by:
getBDABeansXmlScanner in interface ScannerService

isBDABeansXmlScanningEnabled

public boolean isBDABeansXmlScanningEnabled()
Specified by:
isBDABeansXmlScanningEnabled in interface ScannerService


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.