javax.cache
Interface Cache<K,V>
- All Superinterfaces:
- CacheLifecycle, java.lang.Iterable<Cache.Entry<K,V>>
- All Known Subinterfaces:
- ObjectCache<K,V>
- All Known Implementing Classes:
- AbstractCache, CacheImpl, ClusterCache, LocalCache, MemcachedClient, TransientCache
public interface Cache<K,V>
- extends java.lang.Iterable<Cache.Entry<K,V>>, CacheLifecycle
The persistent or distributed cache is usable like a normal map, but loads
and stores data across the cluster.
Method Summary |
boolean |
containsKey(K key)
|
V |
get(java.lang.Object key)
|
java.util.Map<K,V> |
getAll(java.util.Set<? extends K> keys)
|
V |
getAndPut(K key,
V value)
|
V |
getAndRemove(K key)
|
V |
getAndReplace(K key,
V value)
|
CacheManager |
getCacheManager()
|
CacheConfiguration<K,V> |
getConfiguration()
|
CacheMXBean |
getMBean()
|
java.lang.String |
getName()
|
CacheStatistics |
getStatistics()
|
java.lang.Object |
invokeEntryProcessor(K key,
Cache.EntryProcessor<K,V> entryProcessor)
|
java.util.Iterator<Cache.Entry<K,V>> |
iterator()
|
java.util.concurrent.Future<V> |
load(K key)
|
java.util.concurrent.Future<java.util.Map<K,? extends V>> |
loadAll(java.util.Set<? extends K> keys)
|
void |
put(K key,
V value)
|
void |
putAll(java.util.Map<? extends K,? extends V> map)
|
boolean |
putIfAbsent(K key,
V value)
|
boolean |
registerCacheEntryListener(CacheEntryListener<? super K,? super V> listener)
|
boolean |
remove(K key)
|
boolean |
remove(K key,
V oldValue)
|
void |
removeAll()
|
void |
removeAll(java.util.Set<? extends K> keys)
|
boolean |
replace(K key,
V value)
|
boolean |
replace(K key,
V oldValue,
V newValue)
|
boolean |
unregisterCacheEntryListener(CacheEntryListener<?,?> listener)
|
|
unwrap(java.lang.Class<T> cl)
|
get
V get(java.lang.Object key)
getAll
java.util.Map<K,V> getAll(java.util.Set<? extends K> keys)
containsKey
boolean containsKey(K key)
put
void put(K key,
V value)
getAndPut
V getAndPut(K key,
V value)
putAll
void putAll(java.util.Map<? extends K,? extends V> map)
putIfAbsent
boolean putIfAbsent(K key,
V value)
remove
boolean remove(K key)
remove
boolean remove(K key,
V oldValue)
getAndRemove
V getAndRemove(K key)
replace
boolean replace(K key,
V oldValue,
V newValue)
replace
boolean replace(K key,
V value)
getAndReplace
V getAndReplace(K key,
V value)
removeAll
void removeAll(java.util.Set<? extends K> keys)
removeAll
void removeAll()
load
java.util.concurrent.Future<V> load(K key)
loadAll
java.util.concurrent.Future<java.util.Map<K,? extends V>> loadAll(java.util.Set<? extends K> keys)
invokeEntryProcessor
java.lang.Object invokeEntryProcessor(K key,
Cache.EntryProcessor<K,V> entryProcessor)
registerCacheEntryListener
boolean registerCacheEntryListener(CacheEntryListener<? super K,? super V> listener)
unregisterCacheEntryListener
boolean unregisterCacheEntryListener(CacheEntryListener<?,?> listener)
getName
java.lang.String getName()
getCacheManager
CacheManager getCacheManager()
getConfiguration
CacheConfiguration<K,V> getConfiguration()
getStatistics
CacheStatistics getStatistics()
iterator
java.util.Iterator<Cache.Entry<K,V>> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<Cache.Entry<K,V>>
getMBean
CacheMXBean getMBean()
unwrap
<T> T unwrap(java.lang.Class<T> cl)