com.caucho.config.xml
Class XmlBean<X>

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<X>
              extended by com.caucho.config.xml.XmlBean<X>
All Implemented Interfaces:
AnnotatedBean, ScopeAdapterBean<X>, ObjectProxy, Contextual<X>, Bean<X>, InjectionTarget<X>, PassivationCapable, Producer<X>

@Module
public class XmlBean<X>
extends BeanWrapper<X>
implements InjectionTarget<X>, ScopeAdapterBean<X>, PassivationCapable

Internal implementation for a Bean


Constructor Summary
XmlBean(ManagedBeanImpl<X> bean, XmlInjectionTarget<X> injectionTarget)
           
 
Method Summary
 X create(CreationalContext<X> env)
          Creates a new instance for the Contextual's type.
 void dispose(X instance)
          Call destroy
 Annotated getAnnotated()
           
 AnnotatedType<X> getAnnotatedType()
           
 ManagedBeanImpl<X> getBean()
           
 java.util.Set<InjectionPoint> getInjectionPoints()
          Returns the injection points.
 InjectionTarget<X> getInjectionTarget()
           
 X getScopeAdapter(Bean<?> topBean, CreationalContextImpl<X> context)
           
 void inject(X instance, CreationalContext<X> env)
          Inject the bean.
 void postConstruct(X instance)
          PostConstruct initialization
 void preDestroy(X instance)
          Call destroy
 X produce(CreationalContext<X> context)
          Instantiate the bean.
 
Methods inherited from class com.caucho.config.inject.BeanWrapper
destroy
 
Methods inherited from class com.caucho.config.inject.BeanAdapter
getBeanClass, getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable
 
Methods inherited from class com.caucho.config.inject.AbstractBean
calculatePassivationId, createObject, getBeanManager, getId, getJavaClass, introspect, isPassivationCapable, toDisplayString, toDisplayStringImpl, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.inject.spi.PassivationCapable
getId
 

Constructor Detail

XmlBean

public XmlBean(ManagedBeanImpl<X> bean,
               XmlInjectionTarget<X> injectionTarget)
Method Detail

getBean

public ManagedBeanImpl<X> getBean()
Overrides:
getBean in class BeanAdapter<X,X>

getAnnotated

public Annotated getAnnotated()
Specified by:
getAnnotated in interface AnnotatedBean
Overrides:
getAnnotated in class BeanAdapter<X,X>

getAnnotatedType

public AnnotatedType<X> getAnnotatedType()
Overrides:
getAnnotatedType in class AbstractBean<X>

getInjectionTarget

public InjectionTarget<X> getInjectionTarget()
Overrides:
getInjectionTarget in class AbstractBean<X>

getScopeAdapter

public X getScopeAdapter(Bean<?> topBean,
                         CreationalContextImpl<X> context)
Specified by:
getScopeAdapter in interface ScopeAdapterBean<X>

create

public X create(CreationalContext<X> 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<X>
Overrides:
create in class BeanWrapper<X>
Parameters:
env - the creation context used to support circular references.
Returns:
the new instance

produce

public X produce(CreationalContext<X> context)
Description copied from interface: Producer
Instantiate the bean.

Specified by:
produce in interface Producer<X>

inject

public void inject(X instance,
                   CreationalContext<X> env)
Description copied from interface: InjectionTarget
Inject the bean.

Specified by:
inject in interface InjectionTarget<X>

postConstruct

public void postConstruct(X instance)
Description copied from interface: InjectionTarget
PostConstruct initialization

Specified by:
postConstruct in interface InjectionTarget<X>

preDestroy

public void preDestroy(X instance)
Call destroy

Specified by:
preDestroy in interface InjectionTarget<X>

dispose

public void dispose(X instance)
Call destroy

Specified by:
dispose in interface Producer<X>

getInjectionPoints

public java.util.Set<InjectionPoint> getInjectionPoints()
Returns the injection points.

Specified by:
getInjectionPoints in interface Bean<X>
Specified by:
getInjectionPoints in interface Producer<X>
Overrides:
getInjectionPoints in class BeanAdapter<X,X>