Class ApplicationCacheAccessor
java.lang.Object
org.silverpeas.kernel.cache.service.ApplicationCacheAccessor
- All Implemented Interfaces:
CacheAccessor<ExternalCache>
An accessor to a cache whose lifetime is within the whole application runtime. This accessor uses
a specific implementation of the cache that is retrieved by using the Java Service Loader
mechanism. So, through this accessor you can use tiers caching subsystem like Infinispan or
EhCache for example, for better performance. This is why this accessor maintains only a single
instance of such a cache. In the case no external cache is available, then by default an
in-memory cache is used, meaning no additional cache functionalities (like time-to-live for
example) are supported.
- Author:
- mmoquillon
- API Note:
- The
ApplicationCacheAccessoris a singleton.
-
Method Summary
Modifier and TypeMethodDescriptiongetCache()Gets an instance of the cache referred by this accessor.static ApplicationCacheAccessorGets the single instance ofApplicationCacheAccessor.
-
Method Details
-
getInstance
Gets the single instance ofApplicationCacheAccessor.- 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<ExternalCache>- Returns:
- the cache referred by this accessor.
-