org.apache.webbeans.intercept
Class ApplicationScopedBeanInterceptorHandler
java.lang.Object
org.apache.webbeans.intercept.InterceptorHandler
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
org.apache.webbeans.intercept.ApplicationScopedBeanInterceptorHandler
- All Implemented Interfaces:
- Serializable, javassist.util.proxy.MethodHandler
public class ApplicationScopedBeanInterceptorHandler
- extends NormalScopedBeanInterceptorHandler
This is a 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApplicationScopedBeanInterceptorHandler
public ApplicationScopedBeanInterceptorHandler(OwbBean<?> bean,
javax.enterprise.context.spi.CreationalContext<?> creationalContext)
- Creates a new handler.
- Parameters:
bean - beancreationalContext - creaitonal context
getContextualInstance
protected Object getContextualInstance()
- Gets instance from context.
- Overrides:
getContextualInstance in class NormalScopedBeanInterceptorHandler
- Returns:
- the underlying contextual instance, either cached or resolved from the context
getContextualCreationalContext
protected javax.enterprise.context.spi.CreationalContext<Object> getContextualCreationalContext()
- Overrides:
getContextualCreationalContext in class NormalScopedBeanInterceptorHandler
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.