K
- key typeV
- value typepublic class LocalCache<K,V> extends AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
Cache
based
on a Coherence <local-cache>.Modifier and Type | Class and Description |
---|---|
static class |
LocalCache.EntryIterator<K,V>
JCache Entry iterator
|
m_configuration, m_manager, m_namedCache, m_sJCacheName
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 and Description |
---|
LocalCache(CoherenceBasedCacheManager manager,
String sJCacheName,
LocalCacheConfiguration<K,V> configuration)
Constructs a
LocalCache configured by LocalCacheConfiguration . |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(K key) |
void |
deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> config) |
void |
destroy()
Destroys a
CoherenceBasedCache due to a request from a
CoherenceBasedCacheManager . |
void |
dispatch(CoherenceCacheEventEventDispatcher<K,V> dispatcher)
dispatch outstanding JCache Events
|
V |
get(K key) |
Map<K,V> |
getAll(Set<? extends K> setKey) |
V |
getAndPut(K key,
V value) |
V |
getAndRemove(K key) |
V |
getAndReplace(K key,
V value) |
JCacheContext |
getContext()
Get the JCache context for this JCache's operations
|
JCacheIdentifier |
getIdentifier()
Obtain the internal identifier used for JCache caches.
|
InternalConverter<K> |
getKeyConverter()
Get key converter for this.
|
javax.cache.management.CacheMXBean |
getMBean()
Get JMX Bean associated with Cache.
|
CopyOnWriteArraySet<CoherenceCacheEntryListenerRegistration<K,V>> |
getRegisteredAsynchronousEventListeners()
Get asynchronous CacheEntryEventListeners.
|
CopyOnWriteArraySet<CoherenceCacheEntryListenerRegistration<K,V>> |
getRegisteredSynchronousEventListeners()
Get synchronous CacheEntryEventListeners.
|
JCacheStatistics |
getStatistics()
Get JCache statistics.
|
InternalConverter<V> |
getValueConverter()
Get value converter for this.
|
<T> T |
invoke(K key,
javax.cache.processor.EntryProcessor<K,V,T> proc,
Object... arguments) |
<T> Map<K,javax.cache.processor.EntryProcessorResult<T>> |
invokeAll(Set<? extends K> setKey,
javax.cache.processor.EntryProcessor<K,V,T> proc,
Object... arguments) |
boolean |
isStatisticsEnabled()
Get JCache Statistics status
|
Iterator<javax.cache.Cache.Entry<K,V>> |
iterator() |
void |
loadAll(Set<? extends K> setKeys,
boolean fReplaceExistingValues,
javax.cache.integration.CompletionListener listener) |
void |
onBeforeClosing()
Closes a
CoherenceBasedCache at the request of a call to
Cache.close() . |
void |
processExpiries(K key,
CoherenceCacheEventEventDispatcher<K,V> dispatcher)
Process expiry for entry of key.
|
void |
processExpiries(K keyExpired,
V valueExpired,
CoherenceCacheEventEventDispatcher<K,V> dispatcher)
Dispatch an ExpiryEvent to registered CacheEntryListeners.
|
void |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
boolean |
putIfAbsent(K key,
V value) |
void |
registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> config) |
boolean |
remove(K key) |
boolean |
remove(K key,
V value) |
void |
removeAll() |
void |
removeAll(Set<? extends K> keys) |
boolean |
replace(K key,
V value) |
boolean |
replace(K key,
V valueOrig,
V value) |
void |
setManagementEnabled(boolean fEnabled)
Set JCache Management status.
|
void |
setStatisticsEnabled(boolean fEnabled)
Set JCache statistics status
|
String |
toString() |
close, ensureOpen, getCacheManager, getClassLoader, getConfiguration, getName, isClosed, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public LocalCache(CoherenceBasedCacheManager manager, String sJCacheName, LocalCacheConfiguration<K,V> configuration)
LocalCache
configured by LocalCacheConfiguration
.manager
- the CoherenceBasedCacheManager
that created the LocalCache
sJCacheName
- the JCache Name for the LocalCache
configuration
- the LocalCacheConfiguration
for the LocalCache
public void onBeforeClosing()
AbstractCoherenceBasedCache
CoherenceBasedCache
at the request of a call to
Cache.close()
.onBeforeClosing
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
public JCacheStatistics getStatistics()
getStatistics
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
JCacheStatistics
if enabled, null otherwisepublic boolean isStatisticsEnabled()
AbstractCoherenceBasedCache
isStatisticsEnabled
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
public void setStatisticsEnabled(boolean fEnabled)
AbstractCoherenceBasedCache
setStatisticsEnabled
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
fEnabled
- true to enablepublic void setManagementEnabled(boolean fEnabled)
AbstractCoherenceBasedCache
setManagementEnabled
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
fEnabled
- true to enablepublic javax.cache.management.CacheMXBean getMBean()
AbstractCoherenceBasedCache
getMBean
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
public CopyOnWriteArraySet<CoherenceCacheEntryListenerRegistration<K,V>> getRegisteredSynchronousEventListeners()
public CopyOnWriteArraySet<CoherenceCacheEntryListenerRegistration<K,V>> getRegisteredAsynchronousEventListeners()
public void processExpiries(K key, CoherenceCacheEventEventDispatcher<K,V> dispatcher)
key
- key of entry to be expired.dispatcher
- dispatcher for ExpiryEvent.public void processExpiries(K keyExpired, V valueExpired, CoherenceCacheEventEventDispatcher<K,V> dispatcher)
keyExpired
- key of expired entryvalueExpired
- value of expired entrydispatcher
- dispatch EXPIRED CacheEntryEvent to registered listeners of this cache.public JCacheContext getContext()
public InternalConverter<K> getKeyConverter()
public InternalConverter<V> getValueConverter()
public void dispatch(CoherenceCacheEventEventDispatcher<K,V> dispatcher)
dispatcher
- outstanding JCache eventspublic boolean containsKey(K key)
public void loadAll(Set<? extends K> setKeys, boolean fReplaceExistingValues, javax.cache.integration.CompletionListener listener)
public boolean remove(K key)
public void removeAll()
public void clear()
public <T> T invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> proc, Object... arguments)
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> setKey, javax.cache.processor.EntryProcessor<K,V,T> proc, Object... arguments)
public void registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> config)
public void deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> config)
public JCacheIdentifier getIdentifier()
CoherenceBasedCache
getIdentifier
in interface CoherenceBasedCache<K,V>
getIdentifier
in class AbstractCoherenceBasedCache<K,V,LocalCacheConfiguration<K,V>>
JCacheIdentifier
public void destroy()
CoherenceBasedCache
CoherenceBasedCache
due to a request from a
CoherenceBasedCacheManager
.