org.springframework.jee.inject
Class Jsr250Metadata

java.lang.Object
  extended by org.springframework.jee.inject.Jsr250Metadata
Direct Known Subclasses:
InterceptionMetadata, InterceptorMetadata

public class Jsr250Metadata
extends java.lang.Object

Metadata for JEE 5 injection. Can be supplemented by component-specific metadata such as EJB metadata. Each JeeMetadata is associated with a Spring BeanDefinition and attached as a custom attribute

Author:
Rod Johnson
See Also:
BeanDefinition

Field Summary
static java.lang.String KEY
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
  Jsr250Metadata(DeploymentUnitMetadata deploymentUnitMetadata, java.lang.String name, java.lang.Class<?> componentClass)
          Construct new component metadata
protected Jsr250Metadata(Jsr250Metadata other)
          Copy constructor.
 
Method Summary
 void addInjection(Injection<?> injection)
           
protected  void applyInjections(java.lang.Object instance, java.util.List<? extends Injection<?>> injections)
          Apply the given injection list into the passed object.
 org.springframework.beans.factory.support.AbstractBeanDefinition getBeanDefinition()
          Return the Spring singleton definition that this additional metadata relates to
protected  org.springframework.beans.factory.support.BeanDefinitionRegistry getBeanDefinitionRegistry()
           
 java.lang.Class<?> getComponentClass()
           
 org.springframework.context.ApplicationContext getComponentContext()
           
 java.lang.String getComponentName()
           
 DeploymentUnitMetadata getDeploymentUnitMetadata()
           
 java.util.List<Injection<?>> getInjections()
           
 java.util.List<java.lang.reflect.Method> getLifecycleEventCallbackMethod(LifecycleEvent le)
          Null if childPostConstruct annotation not found
 java.lang.Object getUniqueInstanceOfType(org.springframework.beans.factory.ListableBeanFactory lbf, java.lang.Class type)
           
 void inject(java.lang.Object instance)
          Perform dependency injection on the given instance and invoke the PostConstruct method if any
 void injectAndPostConstruct(java.lang.Object instance)
          Perform dependency injection on the given instance and invoke the PostConstruct method if any
protected  boolean invokeLifecycleMethod(java.lang.Object bean, java.lang.reflect.Method lifecyleMethod)
           
 boolean invokeLifecycleMethod(java.lang.Object bean, java.lang.reflect.Method lifecyleMethod, java.lang.Object[] args)
           
 void invokeLifecycleMethods(java.lang.Object bean, LifecycleEvent le)
           
protected  void invokePostConstructAndRegisterShutdownHook(java.lang.Object instance)
           
 void refresh()
           
 void registerLifecycleEventCallbackMethod(LifecycleEvent le, java.lang.reflect.Method m)
           
protected  java.lang.Object resolve(Injection injection)
          Resolve the given injected value Look first in the Spring singleton factory, then in JNDI name
protected  java.lang.Object resolveByType(java.lang.Class type)
          Subclasses that know about a context can perform special purpose injection here
 void setBeanDefinition(org.springframework.beans.factory.support.AbstractBeanDefinition bd)
           
 void setComponentContext(org.springframework.context.ApplicationContext beanFactoryForInstance, org.springframework.beans.factory.support.BeanDefinitionRegistry bdr)
           
 void setComponentContext(org.springframework.context.support.GenericApplicationContext gac)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final java.lang.String KEY

log

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

Jsr250Metadata

protected Jsr250Metadata(Jsr250Metadata other)
Copy constructor. Performs a shallow copy.

Parameters:
other - other metadata object to copy field state from

Jsr250Metadata

public Jsr250Metadata(DeploymentUnitMetadata deploymentUnitMetadata,
                      java.lang.String name,
                      java.lang.Class<?> componentClass)
Construct new component metadata

Parameters:
deploymentUnitMetadata - metadata for whole deployment. This metadata will be added to indicate the new component to be deployed
name - name of the component
componentClass - class of the component
Method Detail

getComponentName

public java.lang.String getComponentName()

getComponentClass

public java.lang.Class<?> getComponentClass()

setComponentContext

public void setComponentContext(org.springframework.context.ApplicationContext beanFactoryForInstance,
                                org.springframework.beans.factory.support.BeanDefinitionRegistry bdr)

setComponentContext

public final void setComponentContext(org.springframework.context.support.GenericApplicationContext gac)

setBeanDefinition

public void setBeanDefinition(org.springframework.beans.factory.support.AbstractBeanDefinition bd)

getBeanDefinitionRegistry

protected org.springframework.beans.factory.support.BeanDefinitionRegistry getBeanDefinitionRegistry()

getComponentContext

public org.springframework.context.ApplicationContext getComponentContext()

registerLifecycleEventCallbackMethod

public void registerLifecycleEventCallbackMethod(LifecycleEvent le,
                                                 java.lang.reflect.Method m)

getLifecycleEventCallbackMethod

public java.util.List<java.lang.reflect.Method> getLifecycleEventCallbackMethod(LifecycleEvent le)
Null if childPostConstruct annotation not found


getBeanDefinition

public org.springframework.beans.factory.support.AbstractBeanDefinition getBeanDefinition()
Return the Spring singleton definition that this additional metadata relates to

Returns:

addInjection

public void addInjection(Injection<?> injection)

getInjections

public java.util.List<Injection<?>> getInjections()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

inject

public void inject(java.lang.Object instance)
Perform dependency injection on the given instance and invoke the PostConstruct method if any

Parameters:
instance - newly instantiated bean instance. If it is null, static members will be used.

applyInjections

protected void applyInjections(java.lang.Object instance,
                               java.util.List<? extends Injection<?>> injections)
Apply the given injection list into the passed object.

Parameters:
instance -
injections -

injectAndPostConstruct

public void injectAndPostConstruct(java.lang.Object instance)
Perform dependency injection on the given instance and invoke the PostConstruct method if any

Parameters:
instance - newly instantiated singleton instance

invokePostConstructAndRegisterShutdownHook

protected void invokePostConstructAndRegisterShutdownHook(java.lang.Object instance)

resolve

protected java.lang.Object resolve(Injection injection)
Resolve the given injected value Look first in the Spring singleton factory, then in JNDI name

Parameters:
injection - injection metadata
Returns:
object from Spring context or JNDI

resolveByType

protected java.lang.Object resolveByType(java.lang.Class type)
                                  throws org.springframework.beans.factory.NoSuchBeanDefinitionException
Subclasses that know about a context can perform special purpose injection here

Parameters:
type -
Returns:
Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException

getUniqueInstanceOfType

public java.lang.Object getUniqueInstanceOfType(org.springframework.beans.factory.ListableBeanFactory lbf,
                                                java.lang.Class type)

invokeLifecycleMethods

public void invokeLifecycleMethods(java.lang.Object bean,
                                   LifecycleEvent le)

invokeLifecycleMethod

protected boolean invokeLifecycleMethod(java.lang.Object bean,
                                        java.lang.reflect.Method lifecyleMethod)

invokeLifecycleMethod

public boolean invokeLifecycleMethod(java.lang.Object bean,
                                     java.lang.reflect.Method lifecyleMethod,
                                     java.lang.Object[] args)

getDeploymentUnitMetadata

public DeploymentUnitMetadata getDeploymentUnitMetadata()

refresh

public void refresh()


Copyright 2006 Interface21. All Rights Reserved.