org.springframework.jee.inject
Class DeploymentUnitMetadata

java.lang.Object
  extended by org.springframework.jee.inject.DeploymentUnitMetadata
All Implemented Interfaces:
DeploymentUnitMetadataI

public class DeploymentUnitMetadata
extends Object
implements DeploymentUnitMetadataI

Metadata associated with whole deployment unit, such as an EJB JAR file. It is possible to find metadata about all deployed components from this.

Author:
Rod Johnson

Constructor Summary
DeploymentUnitMetadata()
           
 
Method Summary
 void associate(ApplicationContext deploymentContext, BeanDefinitionRegistry bdr)
          Associate this DeploymentUnitMetadata with the given deployment unit level ApplicationContext and corresponding BeanDefinitionRegistry.
 String composeCompenvLookupLocation(String name)
          Simple method for composing the final location for a name lookup.
 String composeCompLookupLocation(String name)
           
 ApplicationExceptionInfo getApplicationExceptionInfo(Class<? extends Exception> t)
           
 Map<Class<? extends Exception>,ApplicationExceptionInfo> getApplicationExceptions()
           
 AspectJAdvisorFactory getAspectJAdvisorFactory()
           
 List<Class<?>> getContainerControlInterfaces()
           
 List<InterceptorMetadataI> getDefaultInterceptorMetadata()
           
 List<Jsr250MetadataI> getDeployedComponentMetadata()
           
 ServiceEnvironment getEnvironment()
           
 Platform getTargetPlatform()
          Return the target platform for this deployment unit.
protected  void initEnvironment()
          Used to add a default ServiceEnvironment if none is provided.
 boolean isInvokeLifecycleMethod()
           
 boolean isLimitToSpec()
           
 Object lookup(String name)
          Helper JNDI container-aware lookup method.
 void registerApplicationExceptionInfo(Class<? extends Exception> t, ApplicationExceptionInfo aei)
          Register an applicationExceptionInfo.
 void registerContainerControlInterface(Class<?> containerControlInterface)
          Register the given interface as a container control interface, meaning that it will not be intercepted
 void registerDefaultInterceptorMetadata(InterceptorMetadataI defaultIm)
          Add default interceptor metadata to the deploymentUnitMetadata.
protected  void registerDeployedComponentMetadata(Jsr250Metadata deployedComponentMetadata)
           
 Object resolve(InjectionI injection)
           
 void setEnvironment(ServiceEnvironment environment)
          Set the ServiceEnvironment to be used by this deployment unit.
 void setInvokeLifecycleMethod(boolean invokeLifecycleMethod)
           
 void setLimitToSpec(boolean limitToSpec)
           
 void setTargetPlatform(Platform targetPlatform)
           
 void startup()
          Start the deploymentUnitMetada: register the default interceptors and refresh the deploymentUnitContext as well as metadata contexts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeploymentUnitMetadata

public DeploymentUnitMetadata()
Method Detail

getTargetPlatform

public Platform getTargetPlatform()
Return the target platform for this deployment unit. Controls validation rules that will be applied.

Returns:
the target platform for this deployment unit.

setTargetPlatform

public void setTargetPlatform(Platform targetPlatform)

associate

public void associate(ApplicationContext deploymentContext,
                      BeanDefinitionRegistry bdr)
Associate this DeploymentUnitMetadata with the given deployment unit level ApplicationContext and corresponding BeanDefinitionRegistry. Must be called exactly once.

Parameters:
deploymentContext - deployment unit context
bdr - BeanDefinitionRegistry allowing additions to the context

lookup

public Object lookup(String name)
              throws NamingException
Helper JNDI container-aware lookup method.

Parameters:
name -
Returns:
Throws:
NamingException

resolve

public Object resolve(InjectionI injection)
               throws NamingException
Throws:
NamingException

composeCompenvLookupLocation

public String composeCompenvLookupLocation(String name)
Simple method for composing the final location for a name lookup. Subclasses should extend this to add custom behavior (i.e. different JNDI prefixes).

Parameters:
name -
Returns:

composeCompLookupLocation

public String composeCompLookupLocation(String name)

getAspectJAdvisorFactory

public AspectJAdvisorFactory getAspectJAdvisorFactory()

getDefaultInterceptorMetadata

public List<InterceptorMetadataI> getDefaultInterceptorMetadata()
Returns:
the default interceptors for the deployment unit. Core spec, 11.6

registerDefaultInterceptorMetadata

public void registerDefaultInterceptorMetadata(InterceptorMetadataI defaultIm)
Add default interceptor metadata to the deploymentUnitMetadata. Useful for application servers or managed environments.

Specified by:
registerDefaultInterceptorMetadata in interface DeploymentUnitMetadataI
Parameters:
defaultIm -

getDeployedComponentMetadata

public List<Jsr250MetadataI> getDeployedComponentMetadata()
Specified by:
getDeployedComponentMetadata in interface DeploymentUnitMetadataI
Returns:
the deployedComponents

registerDeployedComponentMetadata

protected void registerDeployedComponentMetadata(Jsr250Metadata deployedComponentMetadata)

isLimitToSpec

public boolean isLimitToSpec()
Returns:
whether or not the container should limit to the spec; for example, not allowing mixing of Spring injection idioms with JEE idioms.

setLimitToSpec

public void setLimitToSpec(boolean limitToSpec)
Parameters:
limitToSpec - the limitToSpec to set

registerApplicationExceptionInfo

public void registerApplicationExceptionInfo(Class<? extends Exception> t,
                                             ApplicationExceptionInfo aei)
Register an applicationExceptionInfo. Useful for application servers or managed environments.

Parameters:
t - applicationException class
aei - applicationExceptionInfo

getApplicationExceptionInfo

public ApplicationExceptionInfo getApplicationExceptionInfo(Class<? extends Exception> t)

registerContainerControlInterface

public void registerContainerControlInterface(Class<?> containerControlInterface)
Register the given interface as a container control interface, meaning that it will not be intercepted

Specified by:
registerContainerControlInterface in interface DeploymentUnitMetadataI
Parameters:
containerControlInterface - container control interface which proxies should implement but whose methods will not be intercepted

getContainerControlInterfaces

public List<Class<?>> getContainerControlInterfaces()

startup

public void startup()
Start the deploymentUnitMetada: register the default interceptors and refresh the deploymentUnitContext as well as metadata contexts.

Specified by:
startup in interface DeploymentUnitMetadataI

initEnvironment

protected void initEnvironment()
Used to add a default ServiceEnvironment if none is provided.


getApplicationExceptions

public Map<Class<? extends Exception>,ApplicationExceptionInfo> getApplicationExceptions()
Returns:
Returns the applicationExceptions.

getEnvironment

public ServiceEnvironment getEnvironment()
Returns:
Returns the environment.

setEnvironment

public void setEnvironment(ServiceEnvironment environment)
Set the ServiceEnvironment to be used by this deployment unit. By default, AutodetectBeanFactoryServiceEnvironment is used.

Parameters:
environment - The environment to set.
See Also:
AutodetectBeanFactoryServiceEnvironment

isInvokeLifecycleMethod

public boolean isInvokeLifecycleMethod()

setInvokeLifecycleMethod

public void setInvokeLifecycleMethod(boolean invokeLifecycleMethod)


Copyright © 2006-2008 SpringSource (formerly Interface21). All Rights Reserved.