Class JCacheContext
- java.lang.Object
-
- com.tangosol.coherence.jcache.common.JCacheContext
-
public class JCacheContext extends Object
Coherence JCache Context on each storage member node for JCache Cache.- Since:
- Coherence 12.1.3
- Author:
- jf 2013.10.24
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JCacheContext(JCacheIdentifier id, javax.cache.configuration.CompleteConfiguration config)
Constructs a context for a JCache cache on each coherence storage node.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.cache.integration.CacheLoader
getCacheLoader()
Return the configured CacheLoader independent if read-through is enabled or not.javax.cache.integration.CacheWriter
getCacheWriter()
If write-through is enabled, return the CacheWriter.javax.cache.configuration.CompleteConfiguration
getConfiguration()
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
getExpiryPolicy()
Get ExpiryPolicyJCacheStatistics
getStatistics()
Return the statistics for this storage node.boolean
isReadThrough()
Is read-through enabled.static void
unregister(ResourceRegistry reg, JCacheIdentifier cacheId)
-
-
-
Constructor Detail
-
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 Detail
-
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
public JCacheStatistics getStatistics()
Return the statistics for this storage node.- Returns:
- statistics
-
getContext
public static JCacheContext getContext(ResourceRegistry reg, JCacheIdentifier cacheId)
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
public static void unregister(ResourceRegistry reg, JCacheIdentifier cacheId)
-
-