Class PassThroughCache<K,V>
- java.lang.Object
-
- com.tangosol.coherence.jcache.AbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>
-
- com.tangosol.coherence.jcache.passthroughcache.PassThroughCache<K,V>
-
- Type Parameters:
K- the type of theCachekeysV- the type of theCachevalues
- All Implemented Interfaces:
CoherenceBasedCache<K,V>,Closeable,AutoCloseable,Iterable<javax.cache.Cache.Entry<K,V>>,javax.cache.Cache<K,V>
public class PassThroughCache<K,V> extends AbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>
ACachethat delegates (ie: passed-through) requests directly onto an existing CoherenceNamedCache.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.10.23
-
-
Field Summary
-
Fields inherited from class com.tangosol.coherence.jcache.AbstractCoherenceBasedCache
m_configuration, m_manager, m_namedCache, m_sJCacheName
-
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
Constructors Constructor Description PassThroughCache(CoherenceBasedCacheManager manager, String sJCacheName, PassThroughCacheConfiguration<K,V> configuration)Constructs aPassThroughCache
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(K key)voidderegisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> configuration)voiddestroy()Destroys aCoherenceBasedCachedue to a request from aCoherenceBasedCacheManager.Vget(K key)Map<K,V>getAll(Set<? extends K> keys)VgetAndPut(K key, V value)VgetAndRemove(K key)VgetAndReplace(K key, V value)JCacheIdentifiergetIdentifier()Obtain the internal identifier used for JCache caches.javax.cache.management.CacheMXBeangetMBean()Get JMX Bean associated with Cache.JCacheStatisticsgetStatistics()Get JCache Statistics associated with Cache.<T> Tinvoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)booleanisStatisticsEnabled()Get JCache Statistics statusIterator<javax.cache.Cache.Entry<K,V>>iterator()voidloadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)voidonBeforeClosing()Closes aCoherenceBasedCacheat the request of a call toCache.close().voidput(K key, V value)voidputAll(Map<? extends K,? extends V> map)booleanputIfAbsent(K key, V value)voidregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> configuration)booleanremove(K key)booleanremove(K key, V oldValue)voidremoveAll()voidremoveAll(Set<? extends K> keys)booleanreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)voidsetManagementEnabled(boolean fEnabled)Set JCache Management status.voidsetStatisticsEnabled(boolean fEnabled)Set JCache statistics status-
Methods inherited from class com.tangosol.coherence.jcache.AbstractCoherenceBasedCache
close, ensureOpen, getCacheManager, getClassLoader, getConfiguration, getName, isClosed, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
PassThroughCache
public PassThroughCache(CoherenceBasedCacheManager manager, String sJCacheName, PassThroughCacheConfiguration<K,V> configuration)
Constructs aPassThroughCache- Parameters:
manager- theCoherenceBasedCacheManagerthat owns theCachesJCacheName- the name of the JCacheCacheconfiguration- thePassThroughCacheConfigurationfor theCache
-
-
Method Detail
-
containsKey
public boolean containsKey(K key)
-
loadAll
public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
-
remove
public boolean remove(K key)
-
removeAll
public void removeAll()
-
clear
public void clear()
-
invoke
public <T> T invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments) throws javax.cache.processor.EntryProcessorException
- Throws:
javax.cache.processor.EntryProcessorException
-
invokeAll
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
-
registerCacheEntryListener
public void registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> configuration)
-
deregisterCacheEntryListener
public void deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> configuration)
-
destroy
public void destroy()
Description copied from interface:CoherenceBasedCacheDestroys aCoherenceBasedCachedue to a request from aCoherenceBasedCacheManager.
-
onBeforeClosing
public void onBeforeClosing()
Description copied from class:AbstractCoherenceBasedCacheCloses aCoherenceBasedCacheat the request of a call toCache.close().- Specified by:
onBeforeClosingin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>
-
getMBean
public javax.cache.management.CacheMXBean getMBean()
Description copied from class:AbstractCoherenceBasedCacheGet JMX Bean associated with Cache.- Specified by:
getMBeanin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>- Returns:
- JMX Bean
-
getStatistics
public JCacheStatistics getStatistics()
Description copied from class:AbstractCoherenceBasedCacheGet JCache Statistics associated with Cache.- Specified by:
getStatisticsin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>- Returns:
- JCache Statistics if exist or null.
-
setManagementEnabled
public void setManagementEnabled(boolean fEnabled)
Description copied from class:AbstractCoherenceBasedCacheSet JCache Management status.- Specified by:
setManagementEnabledin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>- Parameters:
fEnabled- true to enable
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean fEnabled)
Description copied from class:AbstractCoherenceBasedCacheSet JCache statistics status- Specified by:
setStatisticsEnabledin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>- Parameters:
fEnabled- true to enable
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
Description copied from class:AbstractCoherenceBasedCacheGet JCache Statistics status- Specified by:
isStatisticsEnabledin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>- Returns:
- true if enabled, otherwise false
-
getIdentifier
public JCacheIdentifier getIdentifier()
Description copied from interface:CoherenceBasedCacheObtain the internal identifier used for JCache caches.- Specified by:
getIdentifierin interfaceCoherenceBasedCache<K,V>- Specified by:
getIdentifierin classAbstractCoherenceBasedCache<K,V,PassThroughCacheConfiguration<K,V>>- Returns:
- the internal
JCacheIdentifier
-
-