org.springframework.jee.server
Class Bootstrap

java.lang.Object
  extended by org.springframework.jee.server.Bootstrap
Direct Known Subclasses:
EjbBootstrap

public class Bootstrap
extends java.lang.Object

Bootstrap for the JEE container. Each JEE deployment is modelled as a child of a server-level context, and each component also gets its own further child. The deployment-level context contains a Spring singleton definition for each EJB or other JEE component.

Uses the Spring IO abstraction for specifying resource location and resource loading

Author:
Rod Johnson, Michael Chen
See Also:
ResourceLoader

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
Bootstrap()
          Deploy the contributed components, ignoring standard or proprietary deployment descriptors.
Bootstrap(ContainerBootstrap containerBootstrap)
          Start the server-level context.
 
Method Summary
 org.springframework.context.support.GenericApplicationContext deploy()
          Deploy the contributed components, ignoring standard or proprietary deployment descriptors.
 org.springframework.context.support.GenericApplicationContext deploy(ComponentContributor componentContributor)
          Deploy the contributed components, ignoring standard or proprietary deployment descriptors.
 org.springframework.context.support.GenericApplicationContext deploy(org.springframework.core.io.ResourceLoader resourceLoader, ComponentContributor componentContributor)
          Deploy the contributed components, also looking for well-known resources using the given ResourceLoader.
 org.springframework.context.support.GenericApplicationContext deploy(java.lang.String[] requiredSpringLocations, org.springframework.core.io.ResourceLoader resourceLoader, ComponentContributor componentContributor, DeploymentUnitMetadata deploymentUnitMetadata)
          Deploy the contributed components, also looking for well-known resources using the given ResourceLoader.
 org.springframework.context.support.GenericApplicationContext deploy(java.lang.String[] requiredSpringLocations, org.springframework.core.io.ResourceLoader resourceLoader, ComponentContributor componentContributor, DeploymentUnitMetadata deploymentUnitMetadata, java.lang.String... optionalSpringLocations)
          Deploy using the given ComponentContributor, also looking for well-known resources using the given ResourceLoader.
 org.springframework.context.support.GenericApplicationContext getServerApplicationContext()
          Return the application context associated with the server.
 void setValidationService(ValidationService validationService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

Bootstrap

public Bootstrap(ContainerBootstrap containerBootstrap)
Start the server-level context. This is capable of handling multiple JEE deployments.


Bootstrap

public Bootstrap()
Deploy the contributed components, ignoring standard or proprietary deployment descriptors.

Method Detail

setValidationService

public void setValidationService(ValidationService validationService)
Parameters:
validationService - the validationService to set

getServerApplicationContext

public org.springframework.context.support.GenericApplicationContext getServerApplicationContext()
Return the application context associated with the server. This is the parent of the application contexts to which beans are deployed.

Returns:
Server-level application context.

deploy

public org.springframework.context.support.GenericApplicationContext deploy()
                                                                     throws InvalidDeploymentUnitException
Deploy the contributed components, ignoring standard or proprietary deployment descriptors.

Returns:
an application context representing the deployment. This will be a child of the server application context.
Throws:
InvalidDeploymentUnitException

deploy

public org.springframework.context.support.GenericApplicationContext deploy(ComponentContributor componentContributor)
                                                                     throws InvalidDeploymentUnitException
Deploy the contributed components, ignoring standard or proprietary deployment descriptors.

Parameters:
componentContributor - source of component metadata
Returns:
an application context representing the deployment. This will be a child of the server application context.
Throws:
InvalidDeploymentUnitException

deploy

public org.springframework.context.support.GenericApplicationContext deploy(org.springframework.core.io.ResourceLoader resourceLoader,
                                                                            ComponentContributor componentContributor)
                                                                     throws InvalidDeploymentUnitException
Deploy the contributed components, also looking for well-known resources using the given ResourceLoader.

Parameters:
resourceLoader - ResourceLoader used to load resources (for example, from a JAR)
componentContributor - source of component metadata
Returns:
an application context representing the deployment. This will be a child of the server application context.
Throws:
InvalidDeploymentUnitException

deploy

public org.springframework.context.support.GenericApplicationContext deploy(java.lang.String[] requiredSpringLocations,
                                                                            org.springframework.core.io.ResourceLoader resourceLoader,
                                                                            ComponentContributor componentContributor,
                                                                            DeploymentUnitMetadata deploymentUnitMetadata)
                                                                     throws InvalidDeploymentUnitException
Deploy the contributed components, also looking for well-known resources using the given ResourceLoader.

Parameters:
requiredSpringLocations - location of pure Spring files. Spring resource paths.
resourceLoader - ResourceLoader used to load resources (for example, from a JAR)
componentContributor - source of component metadata
deploymentUnitMetadata - may be null, in which case default metadata will be used
Returns:
an application context representing the deployment. This will be a child of the server application context.
Throws:
InvalidDeploymentUnitException

deploy

public org.springframework.context.support.GenericApplicationContext deploy(java.lang.String[] requiredSpringLocations,
                                                                            org.springframework.core.io.ResourceLoader resourceLoader,
                                                                            ComponentContributor componentContributor,
                                                                            DeploymentUnitMetadata deploymentUnitMetadata,
                                                                            java.lang.String... optionalSpringLocations)
                                                                     throws InvalidDeploymentUnitException
Deploy using the given ComponentContributor, also looking for well-known resources using the given ResourceLoader. Enrichers will be used, normally included the standard deployment descriptor enhancer. Also load Spring XML files if specified.

Algorithm: first load annotations for classes, then deployment descriptors (standard, proprietary and Spring), the Spring XML files.

Parameters:
requiredSpringLocations - location of pure Spring files. Spring resource paths.
optionalSpringLocations - location of optional pure Spring files.
resourceLoader - ResourceLoader to use to load resources (for example, from JAR). Standard and proprietary DDs will be sought at this location
componentContributor - source of component metadata
deploymentUnitMetadata - DeploymentUnitMetadata for use. May be null, in which case a default will be used.
Returns:
a GenericApplicationContext which will contain MetadataFactory for the deployment and a Spring singleton definition for each EJB (with the EJB name) and for each Spring singleton.
Throws:
InvalidDeploymentUnitException - if there are errors in the metadata


Copyright 2006 Interface21. All Rights Reserved.