org.jboss.ejb3.interceptors.container
Class LifecycleMethodInterceptorsInvocation

java.lang.Object
  extended by org.jboss.aop.joinpoint.InvocationBase
      extended by org.jboss.aop.joinpoint.ConstructionInvocation
          extended by org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation
All Implemented Interfaces:
java.io.Serializable, org.jboss.aop.joinpoint.Invocation

public class LifecycleMethodInterceptorsInvocation
extends org.jboss.aop.joinpoint.ConstructionInvocation

LifecycleMethodInterceptorsInvocation An Invocation which is aware of the bean context. The LifecycleMethodInterceptorsInvocation is used for creating an AOP invocation for lifecycle callback methods defined either on the bean class or on the interceptor classes associated with the bean. The end target of the LifecycleMethodInterceptorsInvocation, is always a bean instance. But the target (bean instance) is *never* invoked at the end of the interceptor chain. This is because the lifecycle method(s) may or may not be present on the bean class. If there are any lifecycle methods present on the bean class, then its the responsibility of the code using this LifecycleMethodInterceptorsInvocation to create an appropriate AOP interceptor (ex: LifecycleCallbackBeanMethodInterceptor and making it available in the interceptor chain that is passed to the constructor of this class

See Also:
LifecycleCallbackBeanMethodInterceptor, LifecycleCallbackInterceptorMethodInterceptor, Serialized Form

Field Summary
protected  BeanContext<?> beanContext
          Bean context
 
Fields inherited from class org.jboss.aop.joinpoint.ConstructionInvocation
arguments, constructor
 
Fields inherited from class org.jboss.aop.joinpoint.InvocationBase
advisor, currentInterceptor, instanceResolver, interceptors, metadata, responseContextInfo, targetObject
 
Constructor Summary
LifecycleMethodInterceptorsInvocation(BeanContext<?> beanContext, org.jboss.aop.advice.Interceptor[] interceptors)
          Constructor
 
Method Summary
 BeanContext<?> getBeanContext()
          Returns the bean context associated with this invocation
 java.lang.Object invokeTarget()
           
 void setTargetObject(java.lang.Object targetObject)
          Throws exception since we do not allow setting the target object explicitly Don't allow set/overriding the target object.
 
Methods inherited from class org.jboss.aop.joinpoint.ConstructionInvocation
copy, getArguments, getConstructor, getMetaData, getWrapper, invokeNext, resolveAnnotation, resolveTypedAnnotation, setArguments, setConstructor
 
Methods inherited from class org.jboss.aop.joinpoint.InvocationBase
addResponseAttachment, getAdvisor, getCurrentInterceptor, getInstanceResolver, getInterceptors, getMetaData, getResponseAttachment, getResponseContextInfo, getTargetObject, invokeNext, resolveAnnotation, resolveClassAnnotation, resolveClassMetaData, resolveTypedAnnotation, resolveTypedClassAnnotation, setAdvisor, setInstanceResolver, setMetaData, setResponseContextInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanContext

protected BeanContext<?> beanContext
Bean context

Constructor Detail

LifecycleMethodInterceptorsInvocation

public LifecycleMethodInterceptorsInvocation(BeanContext<?> beanContext,
                                             org.jboss.aop.advice.Interceptor[] interceptors)
Constructor

Parameters:
beanContext - The bean context. Cannot be null
interceptors - The interceptors
Throws:
java.lang.IllegalArgumentException - if beanContext is null
Method Detail

getBeanContext

public BeanContext<?> getBeanContext()
Returns the bean context associated with this invocation

Returns:

invokeTarget

public java.lang.Object invokeTarget()
                              throws java.lang.Throwable
Specified by:
invokeTarget in interface org.jboss.aop.joinpoint.Invocation
Overrides:
invokeTarget in class org.jboss.aop.joinpoint.ConstructionInvocation
Throws:
java.lang.Throwable

setTargetObject

public void setTargetObject(java.lang.Object targetObject)
Throws exception since we do not allow setting the target object explicitly Don't allow set/overriding the target object. The target is inferred from the bean context passed to the constructor of this class

Specified by:
setTargetObject in interface org.jboss.aop.joinpoint.Invocation
Overrides:
setTargetObject in class org.jboss.aop.joinpoint.InvocationBase