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

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

public class InterceptorRuntimeBean<X>
extends AbstractInterceptorBean<X>

InterceptorBean represents a Java interceptor


Constructor Summary
InterceptorRuntimeBean(InterceptorRuntimeBean<X> child, java.lang.Class<X> type)
           
 
Method Summary
 X create(CreationalContext<X> cxt)
          Creates a new instance for the Contextual's type.
 void destroy(X instance, CreationalContext<X> env)
          Destroys a bean instance
 boolean equals(java.lang.Object o)
           
 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.reflect.Method getMethod(InterceptionType type)
          Returns the bean's deployment type
 java.lang.String getName()
          Returns the bean's name or null if the bean does not have a primary name.
 InterceptorRuntimeBean<?> getParent()
           
 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.lang.Class<?> getType()
           
 java.util.Set<java.lang.reflect.Type> getTypes()
          Returns the types that the bean implements
 int hashCode()
           
 java.lang.Object intercept(InterceptionType type, X instance, InvocationContext ctx)
          Invokes the callback
 boolean intercepts(InterceptionType type)
          Returns the bean's deployment type
 boolean isAllowParent(InterceptionType type)
           
 boolean isAlternative()
          Returns true if the bean can be null
 boolean isNullable()
          Returns true if the bean can be null
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterceptorRuntimeBean

public InterceptorRuntimeBean(InterceptorRuntimeBean<X> child,
                              java.lang.Class<X> type)
Method Detail

getBean

public Bean<X> getBean()

getType

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

getParent

public InterceptorRuntimeBean<?> getParent()

isAllowParent

public boolean isAllowParent(InterceptionType type)

getQualifiers

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


getStereotypes

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


getName

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


isNullable

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


isAlternative

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


getScope

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


getTypes

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


getBeanClass

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


create

public X create(CreationalContext<X> cxt)
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

Parameters:
cxt - 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

Parameters:
instance - the instance to destroy

getInterceptorBindings

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


intercepts

public boolean intercepts(InterceptionType type)
Returns the bean's deployment type


getMethod

public java.lang.reflect.Method getMethod(InterceptionType type)
Returns the bean's deployment type


getInjectionPoints

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


intercept

public java.lang.Object intercept(InterceptionType type,
                                  X instance,
                                  InvocationContext ctx)
Invokes the callback


equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object