org.springframework.jee.spi
Class WLSBootstrap
java.lang.Object
org.springframework.jee.server.Bootstrap
org.springframework.jee.spi.WLSBootstrap
public class WLSBootstrap
- extends Bootstrap
WLS-specific extension of Bootstrap
. All WLS code should use
this class instead of using Bootstrap
directly.
This implementation hooks the ComponentFactory
into the Spring
instantiation lifecycle, and allows customization of the name of the
Spring-specific resource to load.
This allows WLS to support component extension models other than
Spring, even while continuing to use Spring to provide the baseline
Java EE component model.
- Since:
- 10.0
- Author:
- Safin Li, Michael Chen
Fields inherited from class org.springframework.jee.server.Bootstrap |
log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WLSBootstrap
public WLSBootstrap(ClassLoader loader,
String springConfigurationResourceName,
String componentFactoryClassName,
boolean usesSpringExtensionModel)
- Parameters:
loader
- The ClassLoader
that the components managed by
this instance will be created in. This loader will be used to
locate the ComponentFactory
instance to use for creating
new component objects.springConfigurationResourceName
- A name that should be
examined for Spring configuration data when bootstapping an
application context. This will be added to whatever locations are
specified in deploy(String[],ResourceLoader,
ComponentContributor,DeploymentUnitMetadata,String...)
.
deploy
public GenericApplicationContext deploy(String[] requiredSpringLocations,
ResourceLoader resourceLoader,
ComponentContributor componentContributor,
DeploymentUnitMetadata deploymentUnitMetadata,
String... optionalSpringLocations)
throws InvalidDeploymentUnitException
- Description copied from class:
Bootstrap
- 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.
- Overrides:
deploy
in class Bootstrap
- Parameters:
requiredSpringLocations
- location of pure Spring files. Spring
resource paths.resourceLoader
- ResourceLoader to use to load resources (for
example, from JAR). Standard and proprietary DDs will be
sought at this locationcomponentContributor
- source of component metadatadeploymentUnitMetadata
- DeploymentUnitMetadata for use. May be
null, in which case a default will be used.optionalSpringLocations
- location of optional pure Spring files.
- 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
usesSpringExtensionModel
public boolean usesSpringExtensionModel()
- Whether or not this context uses Spring as its component extension model.
This knowledge is hard-coded because the way we configure the Spring
application context depends on whether or not we're using an alternate
extension model.
Currently (10.0), Spring is the default component model. We might want to
change this to require explicit setting of the component model
(probably through the specification of a well-know ComponentFactory
class) in order for any non-standard component model to be loaded.
usesCustomComponentFactory
public boolean usesCustomComponentFactory()
Copyright © 2006-2008 SpringSource (formerly Interface21). All Rights Reserved.