Class ThreadCacheService

  • All Implemented Interfaces:
    CacheService

    public class ThreadCacheService
    extends Object
    implements CacheService
    A service that uses the local thread to store a cache.
    BE VERY VERY CAREFULLY: into web application with thread pool management, the thread is never killed and the cache is then never cleared. So you have to clear explicitly the cache with the {©ode ThreadCacheService#clearAllCaches()} method.
    Author:
    mmoquillon
    • Constructor Detail

      • ThreadCacheService

        protected ThreadCacheService()
    • Method Detail

      • getCache

        public SimpleCache getCache()
        Description copied from interface: CacheService
        Gets a cache from this service.
        Specified by:
        getCache in interface CacheService
        Returns:
        either a new cache or a single one according to the policy of the service about the cache(s) on which it works.
      • clearAllCaches

        public void clearAllCaches()
        Description copied from interface: CacheService
        Clears all the caches on which this service works.
        Specified by:
        clearAllCaches in interface CacheService