org.apache.webbeans.web.intercept
Class RequestScopedBeanInterceptorHandler

java.lang.Object
  extended by org.apache.webbeans.intercept.InterceptorHandler
      extended by org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
          extended by org.apache.webbeans.web.intercept.RequestScopedBeanInterceptorHandler
All Implemented Interfaces:
Serializable, javassist.util.proxy.MethodHandler

public class RequestScopedBeanInterceptorHandler
extends NormalScopedBeanInterceptorHandler

This is a MethodHandler especially made for @RequestScoped beans used in web applications.

Since there is only one single contextual instance of an @RequestScoped bean per thread, we can simply cache this instance inside our bean. We only need to reload this instance if it is null or if the thread ends.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.webbeans.intercept.InterceptorHandler
bean, interceptedMethodMap, webBeansContext
 
Constructor Summary
RequestScopedBeanInterceptorHandler(OwbBean<?> bean, javax.enterprise.context.spi.CreationalContext<?> creationalContext)
          Creates a new handler.
 
Method Summary
protected  javax.enterprise.context.spi.CreationalContext<Object> getContextualCreationalContext()
           
protected  Object getContextualInstance()
          
static void removeThreadLocals()
           
 
Methods inherited from class org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
callAroundInvokes, invoke, isNotInterceptedOrDecoratedMethod, setNotInterceptedOrDecoratedMethod
 
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

RequestScopedBeanInterceptorHandler

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

Parameters:
bean - bean
creationalContext - creaitonal context
Method Detail

removeThreadLocals

public static void removeThreadLocals()

getContextualInstance

protected Object getContextualInstance()

Overrides:
getContextualInstance in class NormalScopedBeanInterceptorHandler

getContextualCreationalContext

protected javax.enterprise.context.spi.CreationalContext<Object> getContextualCreationalContext()
Overrides:
getContextualCreationalContext in class NormalScopedBeanInterceptorHandler


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