Class CacheServiceProvider
- java.lang.Object
-
- org.silverpeas.core.cache.service.CacheServiceProvider
-
public class CacheServiceProvider extends Object
A provider of different kinds of cache services available in Silverpeas.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearAllThreadCaches()
Clears all caches associated to the current thread: Request Cache Service Thread Cache Servicestatic CacheService
getApplicationCacheService()
Gets the cache of the application.static CacheService
getRequestCacheService()
Gets a useful cache in relation with a request: after the end of the request execution, the associated cache is trashed.static CacheService
getSessionCacheService()
Gets a useful cache in relation with a session: after the end of the session, the associated cache is trashed.static CacheService
getThreadCacheService()
Gets a useful volatile cache: after the end of the current thread execution, the associated cache is trashed.
-
-
-
Method Detail
-
getThreadCacheService
public static CacheService getThreadCacheService()
Gets a useful volatile cache: after the end of the current thread execution, the associated cache is trashed. BE VERY VERY VERY CAREFULLY: into web application with thread pool management, the thread is never killed and this cache is never cleared. If you want the cache cleared after the end of the request, please usegetRequestCacheService()
.- Returns:
- a cache associated to the current thread.
-
getRequestCacheService
public static CacheService getRequestCacheService()
Gets a useful cache in relation with a request: after the end of the request execution, the associated cache is trashed.- Returns:
- a cache associated to the current request.
-
getSessionCacheService
public static CacheService getSessionCacheService()
Gets a useful cache in relation with a session: after the end of the session, the associated cache is trashed. If no session cache exists, then it is created and returned.- Returns:
- a cache associated to the current session.
-
getApplicationCacheService
public static CacheService getApplicationCacheService()
Gets the cache of the application.- Returns:
- an applicative cache service
-
clearAllThreadCaches
public static void clearAllThreadCaches()
Clears all caches associated to the current thread:- Request Cache Service
- Thread Cache Service
-
-