Package org.apache.webbeans.intercept
Class ApplicationScopedBeanInterceptorHandler
java.lang.Object
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
org.apache.webbeans.intercept.ApplicationScopedBeanInterceptorHandler
- All Implemented Interfaces:
jakarta.inject.Provider,Serializable
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(jakarta.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!
- See Also:
-
Field Summary
Fields inherited from class org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
bean -
Constructor Summary
ConstructorsConstructorDescriptionApplicationScopedBeanInterceptorHandler(jakarta.enterprise.inject.spi.BeanManager beanManager, jakarta.enterprise.inject.spi.Bean<?> bean) -
Method Summary
Methods inherited from class org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
get, getBean, getBeanManager, readResolve
-
Constructor Details
-
ApplicationScopedBeanInterceptorHandler
public ApplicationScopedBeanInterceptorHandler(jakarta.enterprise.inject.spi.BeanManager beanManager, jakarta.enterprise.inject.spi.Bean<?> bean)
-
-
Method Details
-
getContextualInstance
- Overrides:
getContextualInstancein classNormalScopedBeanInterceptorHandler
-