Class JCacheContext
java.lang.Object
com.tangosol.coherence.jcache.common.JCacheContext
Coherence JCache Context on each storage member node for JCache Cache.
- Since:
- Coherence 12.1.3
- Author:
- jf 2013.10.24
-
Constructor Summary
ModifierConstructorDescriptionprotected
JCacheContext
(JCacheIdentifier id, javax.cache.configuration.CompleteConfiguration config) Constructs a context for a JCache cache on each coherence storage node. -
Method Summary
Modifier and TypeMethodDescriptionjavax.cache.integration.CacheLoader
Return the configured CacheLoader independent if read-through is enabled or not.javax.cache.integration.CacheWriter
If write-through is enabled, return the CacheWriter.javax.cache.configuration.CompleteConfiguration
Return the JCache cache configurationstatic JCacheContext
getContext
(ResourceRegistry reg, JCacheIdentifier cacheId) Get a JCacheContext forcacheId
inResourceRegistry
static JCacheContext
getContext
(ResourceRegistry reg, JCacheIdentifier cacheId, javax.cache.configuration.CompleteConfiguration config) Get or Create a JCacheContext forcacheId
inResourceRegistry
javax.cache.expiry.ExpiryPolicy
Get ExpiryPolicyReturn the statistics for this storage node.boolean
Is read-through enabled.static void
unregister
(ResourceRegistry reg, JCacheIdentifier cacheId)
-
Constructor Details
-
JCacheContext
protected JCacheContext(JCacheIdentifier id, javax.cache.configuration.CompleteConfiguration config) Constructs a context for a JCache cache on each coherence storage node.- Parameters:
id
- JCache cache unique identifierconfig
- configuration for JCache {code}id{/code}
-
-
Method Details
-
getExpiryPolicy
public javax.cache.expiry.ExpiryPolicy getExpiryPolicy()Get ExpiryPolicy- Returns:
- the contexts ExpiryPolicy
-
isReadThrough
public boolean isReadThrough()Is read-through enabled.- Returns:
- true if readThrough is enabled
-
getCacheLoader
public javax.cache.integration.CacheLoader getCacheLoader()Return the configured CacheLoader independent if read-through is enabled or not. Note: JCache loadAll works independent of read-through being enabled.- Returns:
- the configured CacheLoader
-
getCacheWriter
public javax.cache.integration.CacheWriter getCacheWriter()If write-through is enabled, return the CacheWriter.- Returns:
- configured CacheWriter
-
getConfiguration
public javax.cache.configuration.CompleteConfiguration getConfiguration()Return the JCache cache configuration- Returns:
- the JCache cache configuration
-
getStatistics
Return the statistics for this storage node.- Returns:
- statistics
-
getContext
Get a JCacheContext forcacheId
inResourceRegistry
- Parameters:
reg
- Resource Registry to lookup up or create JCacheContext within.cacheId
- identifier for JCacheContext- Returns:
JCacheContext
for cache identified bycacheId
or null if not registered yet.
-
getContext
public static JCacheContext getContext(ResourceRegistry reg, JCacheIdentifier cacheId, javax.cache.configuration.CompleteConfiguration config) Get or Create a JCacheContext forcacheId
inResourceRegistry
- Parameters:
reg
- Resource Registry to lookup up or create JCacheContext within.cacheId
- identifier for JCacheContextconfig
- JCache Configuration to associate with a new JCacheContext.- Returns:
JCacheContext
for cache identified bycacheId
-
unregister
-