org.jboss.ejb3.interceptors.aop
Class LifecycleCallbackInterceptorMethodLazyInterceptor

java.lang.Object
  extended by org.jboss.ejb3.interceptors.aop.LifecycleCallbackInterceptorMethodLazyInterceptor
All Implemented Interfaces:
org.jboss.aop.advice.Interceptor

public class LifecycleCallbackInterceptorMethodLazyInterceptor
extends java.lang.Object
implements org.jboss.aop.advice.Interceptor

LifecycleCallbackInterceptorMethodLazyInterceptor An AOP interceptor wrapper for lifecycle callback methods on (javax.interceptor.Interceptors) interceptor classes. Unlike the LifecycleCallbackInterceptorMethodInterceptor AOP interceptor, this class does *not* require a interceptor class instance while creating this interceptor. Instead the interceptor instance is obtained through the Invocation when the Interceptor.invoke(Invocation) method is invoked

See Also:
invoke(Invocation)

Constructor Summary
LifecycleCallbackInterceptorMethodLazyInterceptor(java.lang.Class<?> interceptorClass, java.lang.reflect.Method lifecycleCallbackMethod)
          Creates a LifecycleCallbackInterceptorMethodLazyInterceptor based on the interceptor class and the interceptor method.
 
Method Summary
protected  java.lang.Object getInterceptorInstance(org.jboss.aop.joinpoint.Invocation invocation)
          Returns the lifecycle callback interceptor instance, from the invocation, if available.
 java.lang.String getName()
           
 java.lang.Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
          Invokes the lifecycle callback method on the interceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifecycleCallbackInterceptorMethodLazyInterceptor

public LifecycleCallbackInterceptorMethodLazyInterceptor(java.lang.Class<?> interceptorClass,
                                                         java.lang.reflect.Method lifecycleCallbackMethod)
Creates a LifecycleCallbackInterceptorMethodLazyInterceptor based on the interceptor class and the interceptor method. The interceptor instance, corresponding to the interceptorClass will be obtained through the Invocation (if it's available), when this interceptor is invoked.

Parameters:
interceptorClass - The interceptor class
lifecycleCallbackMethod - The interceptor method
See Also:
getInterceptorInstance(Invocation)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface org.jboss.aop.advice.Interceptor
See Also:
Interceptor.getName()

invoke

public java.lang.Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
                        throws java.lang.Throwable
Invokes the lifecycle callback method on the interceptor. The interceptor instance is obtained from the invocation, if available

Specified by:
invoke in interface org.jboss.aop.advice.Interceptor
Throws:
java.lang.Throwable
See Also:
getInterceptorInstance(Invocation)

getInterceptorInstance

protected java.lang.Object getInterceptorInstance(org.jboss.aop.joinpoint.Invocation invocation)
Returns the lifecycle callback interceptor instance, from the invocation, if available.

Parameters:
invocation - AOP invocation
Returns:
Returns the lifecycle callback interceptor instance
Throws:
java.lang.IllegalStateException - if the interceptor instance cannot be obtained through invocation