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 theCachekeysV- the type of theCachevaluesC- the type of theCacheconfiguration
- 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
FieldsModifier and TypeFieldDescriptionprotected CTheConfigurationfor theCoherenceBasedCache.protected CoherenceBasedCacheManagerTheCoherenceBasedCacheManagerthat owns theCache.protected NamedCacheThe underlyingNamedCachethat holds then entries for theCoherenceBasedCache.protected StringTheCachename 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
ConstructorsConstructorDescriptionAbstractCoherenceBasedCache(CoherenceBasedCacheManager manager, String sJCacheName, C configuration) Constructs anAbstractCoherenceBasedCache. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidEnsures that theCoherenceBasedCacheis open (not closed).javax.cache.CacheManagerprotected ClassLoaderDetermine theClassLoaderto use for theCoherenceBasedCache.getConfiguration(Class<T> clz) abstract JCacheIdentifierObtain the internal identifier used for JCache caches.abstract javax.cache.management.CacheMXBeangetMBean()Get JMX Bean associated with Cache.getName()abstract JCacheStatisticsGet JCache Statistics associated with Cache.booleanisClosed()abstract booleanGet JCache Statistics statusabstract voidCloses aCoherenceBasedCacheat the request of a call toCache.close().abstract voidsetManagementEnabled(boolean fEnabled) Set JCache Management status.abstract voidsetStatisticsEnabled(boolean fEnabled) Set JCache statistics status<T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, replaceMethods inherited from interface com.tangosol.coherence.jcache.CoherenceBasedCache
destroyMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
m_manager
TheCoherenceBasedCacheManagerthat owns theCache. -
m_sJCacheName
TheCachename of theCoherenceBasedCache. -
m_namedCache
The underlyingNamedCachethat holds then entries for theCoherenceBasedCache. -
m_configuration
TheConfigurationfor theCoherenceBasedCache.
-
-
Constructor Details
-
AbstractCoherenceBasedCache
public AbstractCoherenceBasedCache(CoherenceBasedCacheManager manager, String sJCacheName, C configuration) Constructs anAbstractCoherenceBasedCache.- Parameters:
manager- theCoherenceBasedCacheManagerthat owns theCoherenceBasedCachesJCacheName- the name of theCacheconfiguration- theCoherenceBasedConfigurationfor theCache
-
-
Method Details
-
close
public void close() -
getConfiguration
-
getName
-
getCacheManager
public javax.cache.CacheManager getCacheManager() -
isClosed
public boolean isClosed() -
unwrap
-
ensureOpen
Ensures that theCoherenceBasedCacheis open (not closed).- Throws:
IllegalStateException- if theCoherenceBasedCacheis closed
-
onBeforeClosing
public abstract void onBeforeClosing()Closes aCoherenceBasedCacheat the request of a call toCache.close(). -
getClassLoader
Determine theClassLoaderto 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:CoherenceBasedCacheObtain the internal identifier used for JCache caches.- Specified by:
getIdentifierin interfaceCoherenceBasedCache<K,V> - Returns:
- the internal
JCacheIdentifier
-