Package org.jboss.weld.contexts.cache
Class RequestScopedCache
java.lang.Object
org.jboss.weld.contexts.cache.RequestScopedCache
Caches beans over the life of a request, to allow for efficient bean lookups from proxies.
Besides, can hold any ThreadLocals to be removed at the end of the request.
- Author:
- Stuart Douglas
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddItem(RequestScopedItem item) static booleanaddItemIfActive(ThreadLocal<?> item) static booleanstatic voidstatic voidends the request and clears the cache.static voidFlushes the bean cache.static booleanisActive()
-
Method Details
-
isActive
public static boolean isActive() -
addItem
-
addItemIfActive
-
addItemIfActive
-
beginRequest
public static void beginRequest() -
endRequest
public static void endRequest()ends the request and clears the cache. This can be called before the request is over, in which case the cache will be unavailable for the rest of the request. -
invalidate
public static void invalidate()Flushes the bean cache. The cache remains available for the rest of the request.
-