K - the type of keys maintained by this mapV - the type of mapped values*public final class RICache<K,V> extends Object implements javax.cache.Cache<K,V>
This is meant to act as a proof of concept for the API. It is not threadsafe or high performance and does limit the size of caches or provide eviction. It therefore is not suitable for use in production. Please use a production implementation of the API.
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
close() |
boolean |
containsKey(K key) |
void |
deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
V |
get(K key) |
Map<K,V> |
getAll(Set<? extends K> keys) |
V |
getAndPut(K key,
V value) |
V |
getAndRemove(K key) |
V |
getAndReplace(K key,
V value) |
javax.cache.CacheManager |
getCacheManager() |
javax.cache.management.CacheMXBean |
getCacheMXBean() |
javax.cache.management.CacheStatisticsMXBean |
getCacheStatisticsMXBean() |
<C extends javax.cache.configuration.Configuration<K,V>> |
getConfiguration(Class<C> clazz) |
protected javax.cache.expiry.Duration |
getDefaultDuration()
The default Duration to use when a Duration can't be determined.
|
String |
getName() |
long |
getSize()
Returns the size of the cache.
|
<T> T |
invoke(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) |
boolean |
isClosed() |
Iterator<javax.cache.Cache.Entry<K,V>> |
iterator() |
void |
loadAll(Set<? extends K> keys,
boolean replaceExistingValues,
javax.cache.integration.CompletionListener completionListener) |
void |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
void |
putAll(Map<? extends K,? extends V> map,
boolean replaceExistingValues) |
void |
putAll(Map<? extends K,? extends V> map,
boolean replaceExistingValues,
boolean useWriteThrough)
A implementation of PutAll that allows optional replacement of existing
values and optionally writing values when Write Through is configured.
|
boolean |
putIfAbsent(K key,
V value) |
void |
registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
boolean |
remove(K key) |
boolean |
remove(K key,
V oldValue) |
void |
removeAll() |
void |
removeAll(Set<? extends K> keys) |
boolean |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
void |
setManagementEnabled(boolean enabled)
Sets management enablement
|
void |
setStatisticsEnabled(boolean enabled)
Sets statistics
|
protected void |
submit(Runnable task)
Requests a
Runnable to be performed. |
<T> T |
unwrap(Class<T> cls) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected void submit(Runnable task)
Runnable to be performed.task - the Runnable to be performedprotected javax.cache.expiry.Duration getDefaultDuration()
public javax.cache.CacheManager getCacheManager()
public void close()
public <C extends javax.cache.configuration.Configuration<K,V>> C getConfiguration(Class<C> clazz)
public boolean containsKey(K key)
public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
public void putAll(Map<? extends K,? extends V> map, boolean replaceExistingValues, boolean useWriteThrough)
map - the Map of entries to putreplaceExistingValues - should existing values be replaced by those in
the map?useWriteThrough - should write-through be used if it is configuredpublic <T> T invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
public javax.cache.management.CacheMXBean getCacheMXBean()
public javax.cache.management.CacheStatisticsMXBean getCacheStatisticsMXBean()
public void setStatisticsEnabled(boolean enabled)
public void setManagementEnabled(boolean enabled)
enabled - true if management should be enabledpublic void registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
public void deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
public long getSize()
Copyright © 2019. All rights reserved.