com.caucho.config.inject
Class BeanWrapper<T>

java.lang.Object
  extended by com.caucho.config.inject.AbstractBean<T>
      extended by com.caucho.config.inject.BeanAdapter<T,T>
          extended by com.caucho.config.inject.BeanWrapper<T>
All Implemented Interfaces:
AnnotatedBean, ObjectProxy, Contextual<T>, Bean<T>
Direct Known Subclasses:
AbstractSingletonBean, XmlBean

@Module
public class BeanWrapper<T>
extends BeanAdapter<T,T>

Internal implementation for a Bean


Constructor Summary
BeanWrapper(InjectManager manager, Bean<T> bean)
           
 
Method Summary
 T create(CreationalContext<T> env)
          Creates a new instance for the Contextual's type.
 void destroy(T instance, CreationalContext<T> env)
          Destroys an instance for the Contextual's type.
 
Methods inherited from class com.caucho.config.inject.BeanAdapter
getAnnotated, getBean, getBeanClass, getInjectionPoints, getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable
 
Methods inherited from class com.caucho.config.inject.AbstractBean
calculatePassivationId, createObject, getAnnotatedType, getBeanManager, getId, getInjectionTarget, getJavaClass, introspect, isPassivationCapable, toDisplayString, toDisplayStringImpl, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanWrapper

public BeanWrapper(InjectManager manager,
                   Bean<T> bean)
Method Detail

create

public T create(CreationalContext<T> env)
Description copied from interface: Contextual
Creates a new instance for the Contextual's type. If the instance already exists in the CreationalContext, create will return it instead of creating a new instance.
  1. create an instance of the bean
  2. create interceptor and decorator stacks
  3. inject dependencies
  4. set any XML-configured values
  5. call @PostConstruct

Specified by:
create in interface Contextual<T>
Specified by:
create in class BeanAdapter<T,T>
Parameters:
env - the creation context used to support circular references.
Returns:
the new instance

destroy

public void destroy(T instance,
                    CreationalContext<T> env)
Description copied from interface: Contextual
Destroys an instance for the Contextual's type.
  1. Call any @Disposal method
  2. Call @PreDestroy methods
  3. Destroy dependent objects

Specified by:
destroy in interface Contextual<T>
Specified by:
destroy in class BeanAdapter<T,T>
Parameters:
instance - the instance to destroy