com.caucho.config.inject
Class ProducesMethodBean<X,T>

java.lang.Object
  extended by com.caucho.config.inject.AbstractBean<T>
      extended by com.caucho.config.inject.AbstractIntrospectedBean<T>
          extended by com.caucho.config.inject.ProducesMethodBean<X,T>
All Implemented Interfaces:
AnnotatedBean, PassivationSetter, ScopeAdapterBean<X>, ObjectProxy, Contextual<T>, Bean<T>, PassivationCapable

@Module
public class ProducesMethodBean<X,T>
extends AbstractIntrospectedBean<T>
implements ScopeAdapterBean<X>


Field Summary
 
Fields inherited from class com.caucho.config.inject.AbstractIntrospectedBean
CURRENT_ANN
 
Method Summary
 void bind()
           
 T create(CreationalContext<T> createEnv)
          Instantiate the bean.
static
<X,T> ProducesMethodBean<X,T>
create(InjectManager manager, Bean<X> producer, AnnotatedMethod<? super X> producesMethod, Arg<? super X>[] producesArgs, AnnotatedMethod<? super X> disposesMethod, Arg<? super X>[] disposesArgs)
           
 void destroy(T instance, CreationalContext<T> cxt)
          Call destroy
 java.lang.Class<?> getBeanClass()
          Returns the bean class.
protected  java.lang.String getDefaultName()
           
 AnnotatedParameter<? super X> getDisposedParameter()
           
 java.util.Set<InjectionPoint> getInjectionPoints()
          Returns the set of injection points, for validation.
 Producer<T> getProducer()
           
 Bean<?> getProducerBean()
           
 AnnotatedMethod<? super X> getProducesMethod()
           
 X getScopeAdapter(Bean<?> topBean, CreationalContextImpl<X> cxt)
           
 void introspect()
           
protected  void introspectSpecializes(Annotated annotated)
          Adds the stereotypes from the bean's annotations
 boolean isInjectionPoint()
           
 boolean isNullable()
          Returns true if the bean can be null
 void setProducer(Producer<T> producer)
           
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.config.inject.AbstractIntrospectedBean
dispose, getAnnotated, getBaseType, getId, getJavaClass, getName, getNamedValue, getQualifiers, getScope, getStereotypes, getTargetClass, getTargetName, getTargetSimpleName, getTargetType, getTypes, introspect, introspectDefault, introspectName, introspectQualifiers, introspectScope, introspectStereotypes, isAlternative, isNormalScope, isPassivating, isPassivationCapable, setPassivating, setPassivationId, toDebugString
 
Methods inherited from class com.caucho.config.inject.AbstractBean
calculatePassivationId, createObject, getAnnotatedType, getBeanManager, getInjectionTarget, toDisplayString, toDisplayStringImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static <X,T> ProducesMethodBean<X,T> create(InjectManager manager,
                                                   Bean<X> producer,
                                                   AnnotatedMethod<? super X> producesMethod,
                                                   Arg<? super X>[] producesArgs,
                                                   AnnotatedMethod<? super X> disposesMethod,
                                                   Arg<? super X>[] disposesArgs)

getProducer

public Producer<T> getProducer()

setProducer

public void setProducer(Producer<T> producer)

getProducerBean

public Bean<?> getProducerBean()

getDefaultName

protected java.lang.String getDefaultName()
Overrides:
getDefaultName in class AbstractIntrospectedBean<T>

isInjectionPoint

public boolean isInjectionPoint()

isNullable

public boolean isNullable()
Description copied from class: AbstractIntrospectedBean
Returns true if the bean can be null

Specified by:
isNullable in interface Bean<T>
Overrides:
isNullable in class AbstractIntrospectedBean<T>

getBeanClass

public java.lang.Class<?> getBeanClass()
Description copied from interface: Bean
Returns the bean class.

Specified by:
getBeanClass in interface Bean<T>
Overrides:
getBeanClass in class AbstractIntrospectedBean<T>

getProducesMethod

public AnnotatedMethod<? super X> getProducesMethod()

getDisposedParameter

public AnnotatedParameter<? super X> getDisposedParameter()

getInjectionPoints

public java.util.Set<InjectionPoint> getInjectionPoints()
Description copied from class: AbstractIntrospectedBean
Returns the set of injection points, for validation.

Specified by:
getInjectionPoints in interface Bean<T>
Overrides:
getInjectionPoints in class AbstractIntrospectedBean<T>

introspectSpecializes

protected void introspectSpecializes(Annotated annotated)
Adds the stereotypes from the bean's annotations

Overrides:
introspectSpecializes in class AbstractIntrospectedBean<T>

introspect

public void introspect()
Overrides:
introspect in class AbstractIntrospectedBean<T>

create

public T create(CreationalContext<T> createEnv)
Description copied from class: AbstractIntrospectedBean
Instantiate the bean.

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

getScopeAdapter

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

bind

public void bind()
Overrides:
bind in class AbstractIntrospectedBean<T>

destroy

public void destroy(T instance,
                    CreationalContext<T> cxt)
Call destroy

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

toString

public java.lang.String toString()
Overrides:
toString in class AbstractBean<T>