org.apache.webbeans.xml
Class DefaultBeanArchiveService

java.lang.Object
  extended by org.apache.webbeans.xml.DefaultBeanArchiveService
All Implemented Interfaces:
BeanArchiveService

public class DefaultBeanArchiveService
extends Object
implements BeanArchiveService

Please note that this implementation is not thread safe.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.webbeans.spi.BeanArchiveService
BeanArchiveService.BeanArchiveInformation, BeanArchiveService.BeanDiscoveryMode
 
Constructor Summary
DefaultBeanArchiveService()
           
 
Method Summary
protected  DefaultBeanArchiveInformation createBeanArchiveInformation()
          This method exists for extensibility reasons.
 BeanArchiveService.BeanArchiveInformation getBeanArchiveInformation(URL beanArchiveUrl)
           
protected  Element getBeansRootElement(InputStream xmlStream)
          Gets the root element of the parsed document.
 Set<URL> getRegisteredBeanArchives()
           
protected  String getTrimmedAttribute(Element element, String attributeName)
           
protected  BeanArchiveService.BeanArchiveInformation readBeansXml(InputStream xmlStreamIn)
          Read the information from the given beans.xml and fill it into a BeanArchiveInformation instance.
 void release()
           
protected  String stripProtocol(String urlPath)
          Get rid of any protocol header from the url externalForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBeanArchiveService

public DefaultBeanArchiveService()
Method Detail

getBeanArchiveInformation

public BeanArchiveService.BeanArchiveInformation getBeanArchiveInformation(URL beanArchiveUrl)
Specified by:
getBeanArchiveInformation in interface BeanArchiveService

getRegisteredBeanArchives

public Set<URL> getRegisteredBeanArchives()
Specified by:
getRegisteredBeanArchives in interface BeanArchiveService

createBeanArchiveInformation

protected DefaultBeanArchiveInformation createBeanArchiveInformation()
This method exists for extensibility reasons.


stripProtocol

protected String stripProtocol(String urlPath)
Get rid of any protocol header from the url externalForm

Parameters:
urlPath -

readBeansXml

protected BeanArchiveService.BeanArchiveInformation readBeansXml(InputStream xmlStreamIn)
                                                          throws IOException
Read the information from the given beans.xml and fill it into a BeanArchiveInformation instance.

Throws:
IOException

release

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

getBeansRootElement

protected Element getBeansRootElement(InputStream xmlStream)
                               throws WebBeansException
Gets the root element of the parsed document.

Parameters:
xmlStream - parsed document
Returns:
root element of the document
Throws:
WebBeansException - if any runtime exception occurs

getTrimmedAttribute

protected String getTrimmedAttribute(Element element,
                                     String attributeName)
Returns:
the trimmed attribute value, or null if the attribute does not exist or the attribute is empty


Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.