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 theCache
keysV
- the type of theCache
values
- 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>>
A
Cache
that delegates (ie: passed-through) requests directly
onto an existing Coherence NamedCache
.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.10.23
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.cache.Cache
javax.cache.Cache.Entry<K,
V> -
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
ConstructorDescriptionPassThroughCache
(CoherenceBasedCacheManager manager, String sJCacheName, PassThroughCacheConfiguration<K, V> configuration) Constructs aPassThroughCache
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(K key) void
deregisterCacheEntryListener
(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> configuration) void
destroy()
Destroys aCoherenceBasedCache
due to a request from aCoherenceBasedCacheManager
.getAndRemove
(K key) getAndReplace
(K key, V value) Obtain the internal identifier used for JCache caches.javax.cache.management.CacheMXBean
getMBean()
Get JMX Bean associated with Cache.Get JCache Statistics associated with Cache.<T> T
invokeAll
(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K, V, T> entryProcessor, Object... arguments) boolean
Get JCache Statistics statusiterator()
void
loadAll
(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener) void
Closes aCoherenceBasedCache
at the request of a call toCache.close()
.void
void
boolean
putIfAbsent
(K key, V value) void
registerCacheEntryListener
(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> configuration) boolean
boolean
void
void
boolean
boolean
void
setManagementEnabled
(boolean fEnabled) Set JCache Management status.void
setStatisticsEnabled
(boolean fEnabled) Set JCache statistics statusMethods 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 Details
-
PassThroughCache
public PassThroughCache(CoherenceBasedCacheManager manager, String sJCacheName, PassThroughCacheConfiguration<K, V> configuration) Constructs aPassThroughCache
- Parameters:
manager
- theCoherenceBasedCacheManager
that owns theCache
sJCacheName
- the name of the JCacheCache
configuration
- thePassThroughCacheConfiguration
for theCache
-
-
Method Details
-
get
-
getAll
-
containsKey
-
loadAll
-
put
-
getAndPut
-
putAll
-
putIfAbsent
-
remove
-
remove
-
getAndRemove
-
replace
-
replace
-
getAndReplace
-
removeAll
-
removeAll
public void removeAll() -
clear
public void clear() -
invoke
public <T> T invoke(K key, javax.cache.processor.EntryProcessor<K, V, throws javax.cache.processor.EntryProcessorExceptionT> entryProcessor, Object... arguments) - Throws:
javax.cache.processor.EntryProcessorException
-
invokeAll
-
registerCacheEntryListener
-
deregisterCacheEntryListener
-
iterator
-
destroy
public void destroy()Description copied from interface:CoherenceBasedCache
Destroys aCoherenceBasedCache
due to a request from aCoherenceBasedCacheManager
. -
onBeforeClosing
public void onBeforeClosing()Description copied from class:AbstractCoherenceBasedCache
Closes aCoherenceBasedCache
at the request of a call toCache.close()
.- Specified by:
onBeforeClosing
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>>
-
getMBean
public javax.cache.management.CacheMXBean getMBean()Description copied from class:AbstractCoherenceBasedCache
Get JMX Bean associated with Cache.- Specified by:
getMBean
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>> - Returns:
- JMX Bean
-
getStatistics
Description copied from class:AbstractCoherenceBasedCache
Get JCache Statistics associated with Cache.- Specified by:
getStatistics
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>> - Returns:
- JCache Statistics if exist or null.
-
setManagementEnabled
public void setManagementEnabled(boolean fEnabled) Description copied from class:AbstractCoherenceBasedCache
Set JCache Management status.- Specified by:
setManagementEnabled
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>> - Parameters:
fEnabled
- true to enable
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean fEnabled) Description copied from class:AbstractCoherenceBasedCache
Set JCache statistics status- Specified by:
setStatisticsEnabled
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>> - Parameters:
fEnabled
- true to enable
-
isStatisticsEnabled
public boolean isStatisticsEnabled()Description copied from class:AbstractCoherenceBasedCache
Get JCache Statistics status- Specified by:
isStatisticsEnabled
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>> - 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> - Specified by:
getIdentifier
in classAbstractCoherenceBasedCache<K,
V, PassThroughCacheConfiguration<K, V>> - Returns:
- the internal
JCacheIdentifier
-