org.apache.webbeans.intercept
Class ApplicationScopedBeanIntereptorHandler

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

public class ApplicationScopedBeanIntereptorHandler
extends NormalScopedBeanInterceptorHandler

This is a javassist.util.proxy.MethodHandler.MethodHandler especially made for @ApplicationScoped beans.

Since there is only one single contextual instance of an @ApplicationScoped bean, we can simply cache this instance inside our bean. We only need to reload this instance if it is null. This happens at the first usage and after the MethodHandler got deserialized

See Also:
Serialized Form

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

ApplicationScopedBeanIntereptorHandler

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

Parameters:
bean - bean
creationalContext - creaitonal context
Method Detail

getContextualInstance

protected java.lang.Object getContextualInstance(OwbBean<java.lang.Object> bean)



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