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

java.lang.Object
  extended by com.caucho.config.inject.AbstractBean<T>
      extended by com.caucho.config.inject.AbstractIntrospectedBean<T>
All Implemented Interfaces:
AnnotatedBean, PassivationSetter, ObjectProxy, Contextual<T>, Bean<T>, PassivationCapable
Direct Known Subclasses:
ManagedBeanImpl, NewBean, ProducesFieldBean, ProducesMethodBean

@Module
public class AbstractIntrospectedBean<T>
extends AbstractBean<T>
implements PassivationCapable, PassivationSetter

Common bean introspection for Produces and ManagedBean.


Field Summary
static java.lang.annotation.Annotation[] CURRENT_ANN
           
 
Constructor Summary
AbstractIntrospectedBean(InjectManager manager, java.lang.reflect.Type type, Annotated annotated)
           
 
Method Summary
protected  void bind()
           
 T create(CreationalContext<T> env)
          Instantiate the bean.
 void destroy(T instance, CreationalContext<T> env)
          Call destroy
 void dispose(T instance)
           
 Annotated getAnnotated()
           
 BaseType getBaseType()
           
 java.lang.Class<?> getBeanClass()
          Returns the bean class.
protected  java.lang.String getDefaultName()
           
 java.lang.String getId()
           
 java.util.Set<InjectionPoint> getInjectionPoints()
          Returns the set of injection points, for validation.
 java.lang.Class<?> getJavaClass()
           
 java.lang.String getName()
          Gets the bean's EL qualifier name.
protected  java.lang.String getNamedValue(java.lang.annotation.Annotation ann)
           
 java.util.Set<java.lang.annotation.Annotation> getQualifiers()
          Returns the bean's qualifier types
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Returns the scope
 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
          Returns the bean's stereotypes
 java.lang.Class<?> getTargetClass()
           
 java.lang.String getTargetName()
           
 java.lang.String getTargetSimpleName()
           
 java.lang.reflect.Type getTargetType()
           
 java.util.Set<java.lang.reflect.Type> getTypes()
          Returns the types that the bean implements
 void introspect()
           
protected  void introspect(Annotated annotated)
           
protected  void introspectDefault()
           
protected  void introspectName(Annotated annotated)
          Introspects the qualifier annotations
protected  void introspectQualifiers(Annotated annotated)
          Introspects the qualifier annotations
protected  void introspectScope(Annotated annotated)
          Called for implicit introspection.
protected  void introspectSpecializes(Annotated annotated)
          Adds the stereotypes from the bean's annotations
protected  void introspectStereotypes(Annotated annotated)
          Adds the stereotypes from the bean's annotations
 boolean isAlternative()
          True for a disabled alternative.
protected  boolean isNormalScope()
           
 boolean isNullable()
          Returns true if the bean can be null
protected  boolean isPassivating()
           
 boolean isPassivationCapable()
          Returns true if the bean is serializable
 void setPassivating(boolean isPassivating)
           
 void setPassivationId(java.lang.String passivationId)
           
 java.lang.String toDebugString()
           
 
Methods inherited from class com.caucho.config.inject.AbstractBean
calculatePassivationId, createObject, getAnnotatedType, getBeanManager, getInjectionTarget, toDisplayString, toDisplayStringImpl, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CURRENT_ANN

public static final java.lang.annotation.Annotation[] CURRENT_ANN
Constructor Detail

AbstractIntrospectedBean

public AbstractIntrospectedBean(InjectManager manager,
                                java.lang.reflect.Type type,
                                Annotated annotated)
Method Detail

getBaseType

public BaseType getBaseType()

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 AbstractBean<T>

getJavaClass

public final java.lang.Class<?> getJavaClass()
Overrides:
getJavaClass in class AbstractBean<T>

getTargetType

public java.lang.reflect.Type getTargetType()

getTargetSimpleName

public java.lang.String getTargetSimpleName()

getTargetName

public java.lang.String getTargetName()

getTargetClass

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

getAnnotated

public Annotated getAnnotated()
Specified by:
getAnnotated in interface AnnotatedBean
Overrides:
getAnnotated in class AbstractBean<T>

getName

public java.lang.String getName()
Gets the bean's EL qualifier name.

Specified by:
getName in interface Bean<T>
Overrides:
getName in class AbstractBean<T>

getQualifiers

public java.util.Set<java.lang.annotation.Annotation> getQualifiers()
Returns the bean's qualifier types

Specified by:
getQualifiers in interface Bean<T>
Overrides:
getQualifiers in class AbstractBean<T>

getId

public java.lang.String getId()
Specified by:
getId in interface PassivationCapable
Overrides:
getId in class AbstractBean<T>

setPassivationId

public void setPassivationId(java.lang.String passivationId)
Specified by:
setPassivationId in interface PassivationSetter

getStereotypes

public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
Returns the bean's stereotypes

Specified by:
getStereotypes in interface Bean<T>
Overrides:
getStereotypes in class AbstractBean<T>

getScope

public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
Returns the scope

Specified by:
getScope in interface Bean<T>
Overrides:
getScope in class AbstractBean<T>

getTypes

public java.util.Set<java.lang.reflect.Type> getTypes()
Returns the types that the bean implements

Specified by:
getTypes in interface Bean<T>
Specified by:
getTypes in class AbstractBean<T>

isAlternative

public boolean isAlternative()
Description copied from interface: Bean
True for a disabled alternative.

Specified by:
isAlternative in interface Bean<T>
Overrides:
isAlternative in class AbstractBean<T>

introspect

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

introspect

protected void introspect(Annotated annotated)

introspectScope

protected void introspectScope(Annotated annotated)
Called for implicit introspection.


introspectQualifiers

protected void introspectQualifiers(Annotated annotated)
Introspects the qualifier annotations


introspectName

protected void introspectName(Annotated annotated)
Introspects the qualifier annotations


introspectStereotypes

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


introspectSpecializes

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


introspectDefault

protected void introspectDefault()

getDefaultName

protected java.lang.String getDefaultName()

bind

protected void bind()

isNullable

public boolean isNullable()
Returns true if the bean can be null

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

isPassivationCapable

public boolean isPassivationCapable()
Returns true if the bean is serializable

Overrides:
isPassivationCapable in class AbstractBean<T>

isPassivating

protected boolean isPassivating()

isNormalScope

protected boolean isNormalScope()

setPassivating

public void setPassivating(boolean isPassivating)

create

public T create(CreationalContext<T> env)
Instantiate the bean.

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

destroy

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

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

dispose

public void dispose(T instance)

getInjectionPoints

public java.util.Set<InjectionPoint> getInjectionPoints()
Returns the set of injection points, for validation.

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

getNamedValue

protected java.lang.String getNamedValue(java.lang.annotation.Annotation ann)

toDebugString

public java.lang.String toDebugString()