org.springframework.jee.inject
Class Enricher

java.lang.Object
  extended by org.springframework.jee.inject.Enricher

public class Enricher
extends java.lang.Object

Object that can enrich a GenericApplicationContext with JEE metadata.

Author:
Rod Johnson

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
Enricher(org.springframework.context.ApplicationContext deploymentContext, org.springframework.beans.factory.support.BeanDefinitionRegistry beanDefinitionRegistry)
          Create a new Enricher that will act on the given application context, which relates to a deployment unit such as an EJB JAR file
Enricher(org.springframework.context.support.GenericApplicationContext deploymentContext)
          Convenient method to start up from a GenericApplicationContext, which implements the BeanDefintionRegistry interface as well as the ApplicationContext interface
 
Method Summary
 org.springframework.beans.factory.support.AbstractBeanDefinition attach(Jsr250Metadata jsr250)
          Attach the following metadata, that may relate to an existing Spring singleton or a new component
 DeploymentUnitMetadata getDeploymentUnitMetadata()
           
 void setDeploymentUnitMetadata(DeploymentUnitMetadata deploymentUnitMetadata)
          Optionally override the default DeploymentUnitMetadata, to customize JNDI lookup etc.
 void setValidationService(ValidationService validationService)
          Set the optional ValidationService.
 void startup()
          Start the container.
 
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

Enricher

public Enricher(org.springframework.context.ApplicationContext deploymentContext,
                org.springframework.beans.factory.support.BeanDefinitionRegistry beanDefinitionRegistry)
Create a new Enricher that will act on the given application context, which relates to a deployment unit such as an EJB JAR file

Parameters:
deploymentContext - Spring application context associated with the deployment unit
beanDefinitionRegistry - registry allowing singleton definitions to be manipulated in the deployment unit's context. Can be the same context if it also implements BeanDefinitionRegistry, otherwise the BeanDefinitionRegistry associated with it

Enricher

public Enricher(org.springframework.context.support.GenericApplicationContext deploymentContext)
Convenient method to start up from a GenericApplicationContext, which implements the BeanDefintionRegistry interface as well as the ApplicationContext interface

Parameters:
deploymenContext - application context representing the deployment unit, which also directly allows BeanDefinition retrieval and addition
Method Detail

setDeploymentUnitMetadata

public void setDeploymentUnitMetadata(DeploymentUnitMetadata deploymentUnitMetadata)
Optionally override the default DeploymentUnitMetadata, to customize JNDI lookup etc.

Parameters:
deploymentUnitMetadata - new DefaultDeploymentUnitMetadata to use for components

getDeploymentUnitMetadata

public DeploymentUnitMetadata getDeploymentUnitMetadata()
Returns:
the deploymentUnitMetadata

setValidationService

public void setValidationService(ValidationService validationService)
Set the optional ValidationService. If this is non-null, validation will be invoked automatically before trying to start up the container

Parameters:
validationService - the validationService to set

attach

public org.springframework.beans.factory.support.AbstractBeanDefinition attach(Jsr250Metadata jsr250)
Attach the following metadata, that may relate to an existing Spring singleton or a new component

Parameters:
jsr250 - JEE metadata
Returns:
the relevant BeanDefinition, which may be an existing Spring-managed singleton, or wholly new

startup

public void startup()
             throws InvalidDeploymentUnitException
Start the container.

Throws:
InvalidDeploymentUnitException - if the metadata is invalid. This error will be identified before startup.


Copyright 2006 Interface21. All Rights Reserved.