Package org.jboss.weld.contexts.cache
Class RequestScopedCache
- java.lang.Object
-
- org.jboss.weld.contexts.cache.RequestScopedCache
-
public class RequestScopedCache extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addItem(RequestScopedItem item)
static boolean
addItemIfActive(ThreadLocal<?> item)
static boolean
addItemIfActive(RequestScopedItem item)
static void
beginRequest()
static void
endRequest()
ends the request and clears the cache.static void
invalidate()
Flushes the bean cache.static boolean
isActive()
-
-
-
Method Detail
-
isActive
public static boolean isActive()
-
addItem
public static void addItem(RequestScopedItem item)
-
addItemIfActive
public static boolean addItemIfActive(RequestScopedItem item)
-
addItemIfActive
public static boolean addItemIfActive(ThreadLocal<?> item)
-
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.
-
-