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 protectedJCacheContext(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.CacheLoadergetCacheLoader()Return the configured CacheLoader independent if read-through is enabled or not.javax.cache.integration.CacheWritergetCacheWriter()If write-through is enabled, return the CacheWriter.javax.cache.configuration.CompleteConfigurationgetConfiguration()Return the JCache cache configurationstatic JCacheContextgetContext(ResourceRegistry reg, JCacheIdentifier cacheId)Get a JCacheContext forcacheIdinResourceRegistrystatic JCacheContextgetContext(ResourceRegistry reg, JCacheIdentifier cacheId, javax.cache.configuration.CompleteConfiguration config)Get or Create a JCacheContext forcacheIdinResourceRegistryjavax.cache.expiry.ExpiryPolicygetExpiryPolicy()Get ExpiryPolicyJCacheStatisticsgetStatistics()Return the statistics for this storage node.booleanisReadThrough()Is read-through enabled.static voidunregister(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 forcacheIdinResourceRegistry- Parameters:
reg- Resource Registry to lookup up or create JCacheContext within.cacheId- identifier for JCacheContext- Returns:
JCacheContextfor cache identified bycacheIdor null if not registered yet.
-
getContext
public static JCacheContext getContext(ResourceRegistry reg, JCacheIdentifier cacheId, javax.cache.configuration.CompleteConfiguration config)
Get or Create a JCacheContext forcacheIdinResourceRegistry- Parameters:
reg- Resource Registry to lookup up or create JCacheContext within.cacheId- identifier for JCacheContextconfig- JCache Configuration to associate with a new JCacheContext.- Returns:
JCacheContextfor cache identified bycacheId
-
unregister
public static void unregister(ResourceRegistry reg, JCacheIdentifier cacheId)
-
-