org.jboss.webbeans.bootstrap
Class WebBeansBootstrap

java.lang.Object
  extended by org.jboss.webbeans.bootstrap.WebBeansBootstrap

public class WebBeansBootstrap
extends java.lang.Object

Bootstrapping functionality that is run at application startup and detects and register beans

Author:
Pete Muir

Field Summary
protected  ManagerImpl manager
           
static java.lang.String WEB_BEAN_DISCOVERY_PROPERTY_NAME
           
 
Constructor Summary
WebBeansBootstrap()
           
WebBeansBootstrap(ManagerImpl manager)
          Constructor Starts up with the singleton Manager
 
Method Summary
 void boot(WebBeanDiscovery webBeanDiscovery)
          Starts the boot process.
protected  void createBean(AbstractClassBean<?> bean, java.util.Set<AbstractBean<?,?>> beans)
          Creates a Web Bean from a bean abstraction and adds it to the set of created beans Also creates the implicit field- and method-level beans, if present
protected  java.util.Set<AbstractBean<?,?>> createBeans(java.lang.Iterable<java.lang.Class<?>> classes)
          Creates Web Beans from a set of classes Iterates over the classes and creates a Web Bean of the corresponding type.
protected  java.util.Set<AbstractBean<?,?>> createStandardBeans()
          Creates the standard beans used internally by the RI
static java.lang.String getVersion()
          Gets version information
static java.util.Set<java.lang.Class<? extends WebBeanDiscovery>> getWebBeanDiscoveryClasses()
          Gets the available discovery implementations Parses the web-beans-ri.properties file and for each row describing a discover class, instantiate that class and add it to the set
protected static boolean isTypeSimpleWebBean(java.lang.Class<?> type)
          Indicates if the type is a simple Web Bean
protected  void registerBeans(java.lang.Class<?>... classes)
          Register any beans defined by the provided classes with the manager
protected  void registerBeans(java.lang.Iterable<java.lang.Class<?>> classes)
          Register the bean with the manager, including any standard (built in) beans
protected  void registerManager()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEB_BEAN_DISCOVERY_PROPERTY_NAME

public static java.lang.String WEB_BEAN_DISCOVERY_PROPERTY_NAME

manager

protected ManagerImpl manager
Constructor Detail

WebBeansBootstrap

public WebBeansBootstrap(ManagerImpl manager)
Constructor Starts up with the singleton Manager


WebBeansBootstrap

public WebBeansBootstrap()
Method Detail

registerManager

protected void registerManager()

registerBeans

protected void registerBeans(java.lang.Class<?>... classes)
Register any beans defined by the provided classes with the manager

Parameters:
classes - The classes to register

registerBeans

protected void registerBeans(java.lang.Iterable<java.lang.Class<?>> classes)
Register the bean with the manager, including any standard (built in) beans

Parameters:
classes - The classes to register as Web Beans

createStandardBeans

protected java.util.Set<AbstractBean<?,?>> createStandardBeans()
Creates the standard beans used internally by the RI

Returns:
A set containing the created beans

createBeans

protected java.util.Set<AbstractBean<?,?>> createBeans(java.lang.Iterable<java.lang.Class<?>> classes)
Creates Web Beans from a set of classes Iterates over the classes and creates a Web Bean of the corresponding type. Also register the beans injection points with the resolver. If the bean has producer methods, producer beans are created for these and those injection points are also registered.

Parameters:
classes - The classes to adapt
Returns:
A set of adapted Web Beans

createBean

protected void createBean(AbstractClassBean<?> bean,
                          java.util.Set<AbstractBean<?,?>> beans)
Creates a Web Bean from a bean abstraction and adds it to the set of created beans Also creates the implicit field- and method-level beans, if present

Parameters:
bean - The bean representation
beans - The set of created beans

boot

public void boot(WebBeanDiscovery webBeanDiscovery)
Starts the boot process. Discovers the beans and registers them with the manager. Also resolves the injection points.

Parameters:
webBeanDiscovery - The discovery implementation

getVersion

public static java.lang.String getVersion()
Gets version information

Returns:
The implementation version from the Bootstrap class package.

getWebBeanDiscoveryClasses

public static java.util.Set<java.lang.Class<? extends WebBeanDiscovery>> getWebBeanDiscoveryClasses()
Gets the available discovery implementations Parses the web-beans-ri.properties file and for each row describing a discover class, instantiate that class and add it to the set

Returns:
A set of discovery implementations
See Also:
DeploymentProperties

isTypeSimpleWebBean

protected static boolean isTypeSimpleWebBean(java.lang.Class<?> type)
Indicates if the type is a simple Web Bean

Parameters:
type - The type to inspect
Returns:
True if simple Web Bean, false otherwise


Copyright © 2008. All Rights Reserved.