org.apache.webbeans.intercept
Class NormalScopedBeanInterceptorHandler

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

public class NormalScopedBeanInterceptorHandler
extends InterceptorHandler

Normal scoped beans interceptor handler.

Version:
$Rev: 1182780 $ $Date: 2011-10-13 13:11:03 +0200 (Do, 13 Okt 2011) $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.webbeans.intercept.InterceptorHandler
bean, interceptedMethodMap, webBeansContext
 
Constructor Summary
NormalScopedBeanInterceptorHandler(OwbBean<?> bean, javax.enterprise.context.spi.CreationalContext<?> creationalContext)
          Creates a new bean instance
 
Method Summary
protected  Object callAroundInvokes(Method proceed, Object[] arguments, List<InterceptorData> stack)
          Call around invoke method of the given bean on calling interceptedMethod.
protected  javax.enterprise.context.spi.CreationalContext<Object> getContextualCreationalContext()
           
protected  Object getContextualInstance()
          Gets instance from context.
 Object invoke(Object instance, Method method, Method proceed, Object[] arguments)
          
protected  boolean isNotInterceptedOrDecoratedMethod(Method method)
          This method provides a way to implement a negative cache for methods which are known to become intercepted or decorated.
protected  void setNotInterceptedOrDecoratedMethod(Method method)
          This method will get called after the interceptorStack got evaluated and we found out that it isnt intercepted nor decorated.
 
Methods inherited from class org.apache.webbeans.intercept.InterceptorHandler
getBeanManager, invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormalScopedBeanInterceptorHandler

public NormalScopedBeanInterceptorHandler(OwbBean<?> bean,
                                          javax.enterprise.context.spi.CreationalContext<?> creationalContext)
Creates a new bean instance

Parameters:
bean - bean
creationalContext - creational context
Method Detail

isNotInterceptedOrDecoratedMethod

protected boolean isNotInterceptedOrDecoratedMethod(Method method)
Description copied from class: InterceptorHandler
This method provides a way to implement a negative cache for methods which are known to become intercepted or decorated. This is useful since the calculation actually takes a lot of time.

Overrides:
isNotInterceptedOrDecoratedMethod in class InterceptorHandler
Parameters:
method - which should get invoked
Returns:
true if the method is known to not get intercepted, false we dont know or it gets intercepted
See Also:
InterceptorHandler.setNotInterceptedOrDecoratedMethod(java.lang.reflect.Method)

setNotInterceptedOrDecoratedMethod

protected void setNotInterceptedOrDecoratedMethod(Method method)
Description copied from class: InterceptorHandler
This method will get called after the interceptorStack got evaluated and we found out that it isnt intercepted nor decorated. The information might get cache to skip the evaluation in a later invocation.

Overrides:
setNotInterceptedOrDecoratedMethod in class InterceptorHandler
See Also:
InterceptorHandler.isNotInterceptedOrDecoratedMethod(java.lang.reflect.Method)

invoke

public Object invoke(Object instance,
                     Method method,
                     Method proceed,
                     Object[] arguments)
              throws Exception

Throws:
Exception

callAroundInvokes

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

Specified by:
callAroundInvokes in class InterceptorHandler
Parameters:
proceed - intercepted bean method
arguments - method actual arguments
stack - interceptor stack
Returns:
return of method
Throws:
Exception - for any exception

getContextualInstance

protected Object getContextualInstance()
Gets instance from context.

Returns:
the underlying contextual instance, either cached or resolved from the context

getContextualCreationalContext

protected javax.enterprise.context.spi.CreationalContext<Object> getContextualCreationalContext()


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