Package com.tangosol.coherence.jcache
Class AbstractCoherenceBasedCache<K,V,C extends CoherenceBasedConfiguration<K,V>>
java.lang.Object
com.tangosol.coherence.jcache.AbstractCoherenceBasedCache<K,V,C>
- Type Parameters:
K
- the type of theCache
keysV
- the type of theCache
valuesC
- the type of theCache
configuration
- All Implemented Interfaces:
CoherenceBasedCache<K,
,V> Closeable
,AutoCloseable
,Iterable<javax.cache.Cache.Entry<K,
,V>> javax.cache.Cache<K,
V>
- Direct Known Subclasses:
LocalCache
,PartitionedCache
,PassThroughCache
,RemoteCache
public abstract class AbstractCoherenceBasedCache<K,V,C extends CoherenceBasedConfiguration<K,V>>
extends Object
implements CoherenceBasedCache<K,V>
The base implementation of a
CoherenceBasedCache
.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.11.04
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.cache.Cache
javax.cache.Cache.Entry<K,
V> -
Field Summary
Modifier and TypeFieldDescriptionprotected C
TheConfiguration
for theCoherenceBasedCache
.protected CoherenceBasedCacheManager
TheCoherenceBasedCacheManager
that owns theCache
.protected NamedCache
The underlyingNamedCache
that holds then entries for theCoherenceBasedCache
.protected String
TheCache
name of theCoherenceBasedCache
.Fields inherited from interface com.tangosol.coherence.jcache.CoherenceBasedCache
JCACHE_CONFIG_BACK_SCHEME_NAME, JCACHE_CONFIG_BACK_SCHEME_SERVICE_NAME, JCACHE_CONFIG_CACHE_NAME, JCACHE_CONFIG_SCHEME_NAME, JCACHE_CONFIG_SERVICE_NAME, JCACHE_EXTEND_PROXY_SERVICE_NAME, JCACHE_EXTEND_SCHEME_NAME, JCACHE_EXTEND_SERVICE_NAME, JCACHE_LOCAL_CACHE_NAME_PATTERN, JCACHE_LOCAL_CACHE_NAME_PREFIX, JCACHE_LOCAL_SCHEME_NAME, JCACHE_LOCAL_SERVICE_NAME, JCACHE_PARTITIONED_CACHE_NAME_PATTERN, JCACHE_PARTITIONED_CACHE_NAME_PREFIX, JCACHE_PARTITIONED_SCHEME_NAME, JCACHE_PARTITIONED_SERVICE_NAME, JCACHE_REMOTE_SCHEME
-
Constructor Summary
ConstructorDescriptionAbstractCoherenceBasedCache
(CoherenceBasedCacheManager manager, String sJCacheName, C configuration) Constructs anAbstractCoherenceBasedCache
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
Ensures that theCoherenceBasedCache
is open (not closed).javax.cache.CacheManager
protected ClassLoader
Determine theClassLoader
to use for theCoherenceBasedCache
.getConfiguration
(Class<T> clz) abstract JCacheIdentifier
Obtain the internal identifier used for JCache caches.abstract javax.cache.management.CacheMXBean
getMBean()
Get JMX Bean associated with Cache.getName()
abstract JCacheStatistics
Get JCache Statistics associated with Cache.boolean
isClosed()
abstract boolean
Get JCache Statistics statusabstract void
Closes aCoherenceBasedCache
at the request of a call toCache.close()
.abstract void
setManagementEnabled
(boolean fEnabled) Set JCache Management status.abstract void
setStatisticsEnabled
(boolean fEnabled) Set JCache statistics status<T> T
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.cache.Cache
clear, containsKey, deregisterCacheEntryListener, get, getAll, getAndPut, getAndRemove, getAndReplace, invoke, invokeAll, iterator, loadAll, put, putAll, putIfAbsent, registerCacheEntryListener, remove, remove, removeAll, removeAll, replace, replace
Methods inherited from interface com.tangosol.coherence.jcache.CoherenceBasedCache
destroy
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
m_manager
TheCoherenceBasedCacheManager
that owns theCache
. -
m_sJCacheName
TheCache
name of theCoherenceBasedCache
. -
m_namedCache
The underlyingNamedCache
that holds then entries for theCoherenceBasedCache
. -
m_configuration
TheConfiguration
for theCoherenceBasedCache
.
-
-
Constructor Details
-
AbstractCoherenceBasedCache
public AbstractCoherenceBasedCache(CoherenceBasedCacheManager manager, String sJCacheName, C configuration) Constructs anAbstractCoherenceBasedCache
.- Parameters:
manager
- theCoherenceBasedCacheManager
that owns theCoherenceBasedCache
sJCacheName
- the name of theCache
configuration
- theCoherenceBasedConfiguration
for theCache
-
-
Method Details
-
close
public void close() -
getConfiguration
-
getName
-
getCacheManager
public javax.cache.CacheManager getCacheManager() -
isClosed
public boolean isClosed() -
unwrap
-
ensureOpen
Ensures that theCoherenceBasedCache
is open (not closed).- Throws:
IllegalStateException
- if theCoherenceBasedCache
is closed
-
onBeforeClosing
public abstract void onBeforeClosing()Closes aCoherenceBasedCache
at the request of a call toCache.close()
. -
getClassLoader
Determine theClassLoader
to use for theCoherenceBasedCache
.- Returns:
- the
ClassLoader
-
getMBean
public abstract javax.cache.management.CacheMXBean getMBean()Get JMX Bean associated with Cache.- Returns:
- JMX Bean
-
getStatistics
Get JCache Statistics associated with Cache.- Returns:
- JCache Statistics if exist or null.
-
setManagementEnabled
public abstract void setManagementEnabled(boolean fEnabled) Set JCache Management status.- Parameters:
fEnabled
- true to enable
-
setStatisticsEnabled
public abstract void setStatisticsEnabled(boolean fEnabled) Set JCache statistics status- Parameters:
fEnabled
- true to enable
-
isStatisticsEnabled
public abstract boolean isStatisticsEnabled()Get JCache Statistics status- Returns:
- true if enabled, otherwise false
-
getIdentifier
Description copied from interface:CoherenceBasedCache
Obtain the internal identifier used for JCache caches.- Specified by:
getIdentifier
in interfaceCoherenceBasedCache<K,
V> - Returns:
- the internal
JCacheIdentifier
-