org.apache.webbeans.intercept
Class InterceptorHandler

java.lang.Object
  extended by org.apache.webbeans.intercept.InterceptorHandler
All Implemented Interfaces:
java.io.Serializable, javassist.util.proxy.MethodHandler
Direct Known Subclasses:
DependentScopedBeanInterceptorHandler, NormalScopedBeanInterceptorHandler

public abstract class InterceptorHandler
extends java.lang.Object
implements javassist.util.proxy.MethodHandler, java.io.Serializable

Logic for how interceptors & decorators work in OWB.

Version:
$Rev: 1083103 $ $Date: 2011-03-19 00:15:26 +0100 (Sa, 19 Mär 2011) $
See Also:
WebBeansInterceptorConfig, WebBeansDecoratorConfig, WebBeansInterceptor, WebBeansDecorator, EJBInterceptorConfig, Serialized Form

Field Summary
protected  OwbBean<?> bean
          Proxied bean
protected  java.util.Map<java.lang.reflect.Method,java.util.List<InterceptorData>> interceptedMethodMap
          Intercepted methods
protected  WebBeansContext webBeansContext
           
 
Constructor Summary
protected InterceptorHandler(OwbBean<?> bean)
          Creates a new handler.
 
Method Summary
protected abstract  java.lang.Object callAroundInvokes(java.lang.reflect.Method interceptedMethod, java.lang.Object[] arguments, java.util.List<InterceptorData> stack)
          Call around invoke method of the given bean on calling interceptedMethod.
protected  BeanManagerImpl getBeanManager()
           
 java.lang.Object invoke(java.lang.Object instance, java.lang.reflect.Method method, java.lang.reflect.Method proceed, java.lang.Object[] arguments, CreationalContextImpl<?> ownerCreationalContext)
          Calls decorators and interceptors and actual bean method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javassist.util.proxy.MethodHandler
invoke
 

Field Detail

bean

protected OwbBean<?> bean
Proxied bean


interceptedMethodMap

protected transient volatile java.util.Map<java.lang.reflect.Method,java.util.List<InterceptorData>> interceptedMethodMap
Intercepted methods


webBeansContext

protected WebBeansContext webBeansContext
Constructor Detail

InterceptorHandler

protected InterceptorHandler(OwbBean<?> bean)
Creates a new handler.

Parameters:
bean - proxied bean
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object instance,
                               java.lang.reflect.Method method,
                               java.lang.reflect.Method proceed,
                               java.lang.Object[] arguments,
                               CreationalContextImpl<?> ownerCreationalContext)
                        throws java.lang.Exception
Calls decorators and interceptors and actual bean method.

Parameters:
instance - actual bean instance
method - business method
proceed - proceed method
arguments - method arguments
ownerCreationalContext - bean creational context
Returns:
method result
Throws:
java.lang.Exception - for exception

callAroundInvokes

protected abstract java.lang.Object callAroundInvokes(java.lang.reflect.Method interceptedMethod,
                                                      java.lang.Object[] arguments,
                                                      java.util.List<InterceptorData> stack)
                                               throws java.lang.Exception
Call around invoke method of the given bean on calling interceptedMethod.

Parameters:
interceptedMethod - intercepted bean method
arguments - method actual arguments
stack - interceptor stack
Returns:
return of method
Throws:
java.lang.Exception - for any exception

getBeanManager

protected BeanManagerImpl getBeanManager()
Returns:
bean manager


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.