org.springframework.jee.inject
Class Enricher

java.lang.Object
  extended by org.springframework.jee.inject.Enricher
All Implemented Interfaces:
EnricherI

public class Enricher
extends Object
implements EnricherI

Object that can enrich a GenericApplicationContext with JEE metadata.

Author:
Rod Johnson

Field Summary
protected  Log log
           
 
Constructor Summary
Enricher(ApplicationContext deploymentContext, 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(GenericApplicationContext deploymentContext)
          Convenient method to start up from a GenericApplicationContext, which implements the BeanDefintionRegistry interface as well as the ApplicationContext interface
 
Method Summary
 void attach(Jsr250MetadataI jsr250)
          Attach the following metadata, that may relate to an existing Spring singleton or a new component
 void attach(Jsr250MetadataI jsr250, boolean isSingleton)
           
 DeploymentUnitMetadataI getDeploymentUnitMetadata()
           
 String[] getRegisteredBeanDefinitionNames()
           
 void setDeploymentUnitMetadata(DeploymentUnitMetadataI 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 Log log
Constructor Detail

Enricher

public Enricher(ApplicationContext deploymentContext,
                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(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(DeploymentUnitMetadataI deploymentUnitMetadata)
Optionally override the default DeploymentUnitMetadata, to customize JNDI lookup etc.

Specified by:
setDeploymentUnitMetadata in interface EnricherI
Parameters:
deploymentUnitMetadata - new DefaultDeploymentUnitMetadata to use for components

getDeploymentUnitMetadata

public DeploymentUnitMetadataI getDeploymentUnitMetadata()
Specified by:
getDeploymentUnitMetadata in interface EnricherI
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 void attach(Jsr250MetadataI jsr250)
Attach the following metadata, that may relate to an existing Spring singleton or a new component

Specified by:
attach in interface EnricherI
Parameters:
jsr250 - JEE metadata

attach

public void attach(Jsr250MetadataI jsr250,
                   boolean isSingleton)
Specified by:
attach in interface EnricherI

startup

public void startup()
             throws InvalidDeploymentUnitException
Start the container.

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

getRegisteredBeanDefinitionNames

public String[] getRegisteredBeanDefinitionNames()
Specified by:
getRegisteredBeanDefinitionNames in interface EnricherI


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