cache.put(key, value)
. To get the entry, call cache.get(key)
. The cache configuration affects the lifetime, local caching timeouts and consistency.
{@link Cache}s produced and owned by a {@link CacheManager} typically sharecommon infrastructure, for example, a common {@link ClassLoader} andimplementation specific {@link Properties}.
Implementations of {@link CacheManager} may additionally provide and shareexternal resources between the {@link Cache}s being managed, for example, the content of the managed {@link Cache}s may be stored in the same cluster.
By default {@link CacheManager} instances are typically acquired through theuse of a {@link CachingProvider}. Implementations however may additionally provide other mechanisms to create, acquire, manage and configure {@link CacheManager}s, including:
new
operator to create a concrete implementation, The default {@link CacheManager} however can always be acquired using thedefault configured {@link CachingProvider} obtained by the {@link Caching}class. For example:
CachingProvider provider = Caching.getCachingProvider(); CacheManager manager = provider.getCacheManager();
Within a Java process {@link CacheManager}s and the {@link Cache}s they manage are scoped and uniquely identified by a {@link URI}, the meaning of which is implementation specific. To obtain the default {@link URI}, {@link ClassLoader} and {@link Properties} for an implementation, consult the{@link CachingProvider} class. @author Greg Luck @author Yannis Cosmadopoulos @author Brian Oliver @see Caching @see CachingProvider @see Cache @since 1.0
Shiro doesn't implement a full Cache mechanism itself, since that is outside the core competency of a Security framework. Instead, this interface provides an abstraction (wrapper) API on top of an underlying cache framework's main Manager component (e.g. JCache, Ehcache, JCS, OSCache, JBossCache, TerraCotta, Coherence, GigaSpaces, etc, etc), allowing a Shiro user to configure any cache mechanism they choose. @author Les Hazlewood @since 0.9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|