Class 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 Detail

      • isActive

        public static boolean isActive()
      • 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.