org.jboss.webbeans.bootstrap
Class PropertiesBasedBootstrap

java.lang.Object
  extended by org.jboss.webbeans.bootstrap.WebBeansBootstrap
      extended by org.jboss.webbeans.bootstrap.PropertiesBasedBootstrap
Direct Known Subclasses:
ServletBootstrap

public abstract class PropertiesBasedBootstrap
extends WebBeansBootstrap

An abstract extension of Bootstrap which uses deployment properties for configuring the application

Author:
Pete Muir

Constructor Summary
PropertiesBasedBootstrap()
           
 
Method Summary
protected static
<T> java.lang.reflect.Constructor<? extends T>
getClassConstructor(DeploymentProperties deploymentProperties, ResourceLoader resourceLoader, java.lang.String propertyName, java.lang.Class<T> expectedType, java.lang.Class<?>... constructorArguments)
          Returns any class constructor from the merged list defined by the specified property.
protected abstract  DeploymentProperties getDeploymentProperties()
          Gets the deployment properties
protected static
<T> T
newInstance(java.lang.reflect.Constructor<T> constructor, java.lang.Object... parameters)
          Creates an instance of the type
 
Methods inherited from class org.jboss.webbeans.bootstrap.WebBeansBootstrap
boot, getEjbDiscovery, getManager, getResourceLoader, getVersion, getWebBeanDiscovery, initManager, registerBeans, validateBootstrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesBasedBootstrap

public PropertiesBasedBootstrap()
Method Detail

getClassConstructor

protected static <T> java.lang.reflect.Constructor<? extends T> getClassConstructor(DeploymentProperties deploymentProperties,
                                                                                    ResourceLoader resourceLoader,
                                                                                    java.lang.String propertyName,
                                                                                    java.lang.Class<T> expectedType,
                                                                                    java.lang.Class<?>... constructorArguments)
Returns any class constructor from the merged list defined by the specified property. No guarantee is made about which item in the list will returned.

Type Parameters:
T - The class type
Parameters:
deploymentProperties - The deployment properties to be used
resourceLoader - The resourceLoader to use for class and resource loading
propertyName - The name of the property to find in the deployment properties
expectedType - The expected type or super type of the class
constructorArguments - The arguments of the constructor to select
Returns:

newInstance

protected static <T> T newInstance(java.lang.reflect.Constructor<T> constructor,
                                   java.lang.Object... parameters)
Creates an instance of the type

Parameters:
constructor - The constructor to use
parameters - The parameters to pass to the constructor
Returns:
An instance of the type

getDeploymentProperties

protected abstract DeploymentProperties getDeploymentProperties()
Gets the deployment properties

Returns:
The deployment properties
See Also:
DeploymentProperties


Copyright © 2008-2009. All Rights Reserved.