com.caucho.config.inject
Class InterceptorBean<X>

java.lang.Object
  extended by com.caucho.config.inject.AbstractInterceptorBean<X>
      extended by com.caucho.config.inject.InterceptorRuntimeBean<X>
          extended by com.caucho.config.inject.InterceptorBean<X>
All Implemented Interfaces:
Contextual<X>, Bean<X>, Interceptor<X>

public class InterceptorBean<X>
extends InterceptorRuntimeBean<X>

InterceptorBean represents a Java interceptor


Constructor Summary
InterceptorBean(java.lang.Class<X> type)
           
InterceptorBean(InjectManager beanManager, java.lang.Class<X> type)
           
 
Method Summary
 X create(CreationalContext<X> creationalContext)
          Creates a new instance for the Contextual's type.
 void destroy(X instance, CreationalContext<X> env)
          Destroys a bean instance
 Bean<X> getBean()
           
 java.lang.Class<?> getBeanClass()
          Returns the bean class.
 java.util.Set<InjectionPoint> getInjectionPoints()
          Returns the set of injection points, for validation.
 java.util.Set<java.lang.annotation.Annotation> getInterceptorBindings()
          Returns the bean's binding types
 java.lang.String getName()
          Returns the bean's name or null if the bean does not have a primary name.
 java.util.Set<java.lang.annotation.Annotation> getQualifiers()
          Returns the bean's bindings
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Returns the bean's scope
 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
          Returns the bean's stereotypes
 java.util.Set<java.lang.reflect.Type> getTypes()
          Returns the types that the bean implements
 void init()
           
protected  void introspect()
           
protected  void introspectQualifiers(java.lang.annotation.Annotation[] annList)
           
 boolean isAlternative()
          Returns true if the bean can be null
 boolean isNullable()
          Returns true if the bean can be null
 boolean isPassivationCapable()
          Returns true if the bean is serializable
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.config.inject.InterceptorRuntimeBean
equals, getMethod, getParent, getType, hashCode, intercept, intercepts, isAllowParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterceptorBean

public InterceptorBean(InjectManager beanManager,
                       java.lang.Class<X> type)

InterceptorBean

public InterceptorBean(java.lang.Class<X> type)
Method Detail

getBean

public Bean<X> getBean()
Overrides:
getBean in class InterceptorRuntimeBean<X>

getQualifiers

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

Specified by:
getQualifiers in interface Bean<X>
Overrides:
getQualifiers in class InterceptorRuntimeBean<X>

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<X>
Overrides:
getStereotypes in class InterceptorRuntimeBean<X>

getName

public java.lang.String getName()
Returns the bean's name or null if the bean does not have a primary name.

Specified by:
getName in interface Bean<X>
Overrides:
getName in class InterceptorRuntimeBean<X>

isNullable

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

Specified by:
isNullable in interface Bean<X>
Overrides:
isNullable in class InterceptorRuntimeBean<X>

isAlternative

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

Specified by:
isAlternative in interface Bean<X>
Overrides:
isAlternative in class InterceptorRuntimeBean<X>

isPassivationCapable

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


getScope

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

Specified by:
getScope in interface Bean<X>
Overrides:
getScope in class InterceptorRuntimeBean<X>

getTypes

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

Specified by:
getTypes in interface Bean<X>
Overrides:
getTypes in class InterceptorRuntimeBean<X>

getBeanClass

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

Specified by:
getBeanClass in interface Bean<X>
Overrides:
getBeanClass in class InterceptorRuntimeBean<X>

create

public X create(CreationalContext<X> creationalContext)
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 InterceptorRuntimeBean<X>
Parameters:
creationalContext - the creation context used to support circular references.
Returns:
the new instance

destroy

public void destroy(X instance,
                    CreationalContext<X> env)
Destroys a bean instance

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

getInterceptorBindings

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

Specified by:
getInterceptorBindings in interface Interceptor<X>
Overrides:
getInterceptorBindings in class InterceptorRuntimeBean<X>

getInjectionPoints

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

Specified by:
getInjectionPoints in interface Bean<X>
Overrides:
getInjectionPoints in class InterceptorRuntimeBean<X>

init

public void init()

introspect

protected void introspect()

introspectQualifiers

protected void introspectQualifiers(java.lang.annotation.Annotation[] annList)

toString

public java.lang.String toString()
Overrides:
toString in class InterceptorRuntimeBean<X>