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 Details

    • 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.