Class ThreadCacheAccessor
java.lang.Object
org.silverpeas.kernel.cache.service.ThreadCacheAccessor
- All Implemented Interfaces:
CacheAccessor<SimpleCache>
An accessor to the cache of the current thread. This means the data are per-thread cached and
their lifetime doesn't span over the life of the thread.
BE VERY VERY CAREFUL: with thread pool management, the thread is usually never
killed because thread creation is time consuming. In pool management the threads are reused to
perform another treatment. So, the cache is never by default cleared. This is why you have to
clear explicitly the cache with SimpleCache.clear() once you're done with it.
- Author:
- mmoquillon
-
Method Summary
Modifier and TypeMethodDescriptiongetCache()Gets an instance of the cache referred by this accessor.static ThreadCacheAccessorGets the single instance ofThreadCacheAccessor.
-
Method Details
-
getInstance
Gets the single instance ofThreadCacheAccessor.- Returns:
- the single instance of this class.
-
getCache
Description copied from interface:CacheAccessorGets an instance of the cache referred by this accessor. Despite the method can return at each call either the same instance or different instances, the cache represented by the instances will be the same.- Specified by:
getCachein interfaceCacheAccessor<SimpleCache>- Returns:
- the cache referred by this accessor.
-