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
ConstructorsModifierConstructorDescriptionprotectedJCacheContext(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.CacheLoaderReturn the configured CacheLoader independent if read-through is enabled or not.javax.cache.integration.CacheWriterIf write-through is enabled, return the CacheWriter.javax.cache.configuration.CompleteConfigurationReturn 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.ExpiryPolicyGet ExpiryPolicyReturn the statistics for this storage node.booleanIs read-through enabled.static voidunregister(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 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
-