public class ApplicationScopedBeanInterceptorHandler extends NormalScopedBeanInterceptorHandler
This is a Provider 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
Also if the application uses the AlterableContext.destroy(javax.enterprise.context.spi.Contextual)
method on any ApplicationScoped bean, then the standard NormalScopedBeanInterceptorHandler must be configured to prevent any caching.
Be careful as this might slow down your application!
bean| Constructor and Description |
|---|
ApplicationScopedBeanInterceptorHandler(javax.enterprise.inject.spi.BeanManager beanManager,
javax.enterprise.inject.spi.Bean<?> bean) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
getContextualInstance() |
get, getBean, getBeanManager, readResolvepublic ApplicationScopedBeanInterceptorHandler(javax.enterprise.inject.spi.BeanManager beanManager,
javax.enterprise.inject.spi.Bean<?> bean)
protected Object getContextualInstance()
getContextualInstance in class NormalScopedBeanInterceptorHandlerCopyright © 2008–2020 The Apache Software Foundation. All rights reserved.