org.infinispan.jcache
Class JCache<K,V>

java.lang.Object
  extended by org.infinispan.jcache.JCache<K,V>
All Implemented Interfaces:
Iterable<javax.cache.Cache.Entry<K,V>>, javax.cache.Cache<K,V>, javax.cache.CacheLifecycle

public final class JCache<K,V>
extends Object
implements javax.cache.Cache<K,V>

Infinispan's implementation of Cache interface.

Since:
5.3
Author:
Vladimir Blagojevic, Galder ZamarreƱo

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.cache.Cache
javax.cache.Cache.Entry<K,V>, javax.cache.Cache.EntryProcessor<K,V,T>, javax.cache.Cache.MutableEntry<K,V>
 
Constructor Summary
JCache(AdvancedCache<K,V> cache, JCacheManager cacheManager, javax.cache.Configuration<K,V> c)
           
 
Method Summary
 void clear()
           
 boolean containsKey(K key)
           
 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.Configuration<K,V> getConfiguration()
           
 String getName()
           
 javax.cache.Status getStatus()
           
<T> T
invokeEntryProcessor(K key, javax.cache.Cache.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
           
 Iterator<javax.cache.Cache.Entry<K,V>> iterator()
           
 void loadAll(Iterable<? extends K> keys, boolean replaceExistingValues, javax.cache.event.CompletionListener listener)
           
 void put(K key, V value)
           
 void putAll(Map<? extends K,? extends V> inputMap)
           
 boolean putIfAbsent(K key, V value)
           
 boolean registerCacheEntryListener(javax.cache.event.CacheEntryListener<? super K,? super V> cacheEntryListener, boolean requireOldValue, javax.cache.event.CacheEntryEventFilter<? super K,? super V> cacheEntryFilter, boolean synchronous)
           
 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 start()
           
 void stop()
           
 boolean unregisterCacheEntryListener(javax.cache.event.CacheEntryListener<?,?> cacheEntryListener)
           
<T> T
unwrap(Class<T> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCache

public JCache(AdvancedCache<K,V> cache,
              JCacheManager cacheManager,
              javax.cache.Configuration<K,V> c)
Method Detail

getStatus

public javax.cache.Status getStatus()
Specified by:
getStatus in interface javax.cache.CacheLifecycle

start

public void start()
Specified by:
start in interface javax.cache.CacheLifecycle

stop

public void stop()
Specified by:
stop in interface javax.cache.CacheLifecycle

clear

public void clear()
Specified by:
clear in interface javax.cache.Cache<K,V>

containsKey

public boolean containsKey(K key)
Specified by:
containsKey in interface javax.cache.Cache<K,V>

get

public V get(K key)
Specified by:
get in interface javax.cache.Cache<K,V>

getAll

public Map<K,V> getAll(Set<? extends K> keys)
Specified by:
getAll in interface javax.cache.Cache<K,V>

getAndPut

public V getAndPut(K key,
                   V value)
Specified by:
getAndPut in interface javax.cache.Cache<K,V>

getAndRemove

public V getAndRemove(K key)
Specified by:
getAndRemove in interface javax.cache.Cache<K,V>

getAndReplace

public V getAndReplace(K key,
                       V value)
Specified by:
getAndReplace in interface javax.cache.Cache<K,V>

getCacheManager

public javax.cache.CacheManager getCacheManager()
Specified by:
getCacheManager in interface javax.cache.Cache<K,V>

getConfiguration

public javax.cache.Configuration<K,V> getConfiguration()
Specified by:
getConfiguration in interface javax.cache.Cache<K,V>

getName

public String getName()
Specified by:
getName in interface javax.cache.Cache<K,V>

invokeEntryProcessor

public <T> T invokeEntryProcessor(K key,
                                  javax.cache.Cache.EntryProcessor<K,V,T> entryProcessor,
                                  Object... arguments)
Specified by:
invokeEntryProcessor in interface javax.cache.Cache<K,V>

iterator

public Iterator<javax.cache.Cache.Entry<K,V>> iterator()
Specified by:
iterator in interface Iterable<javax.cache.Cache.Entry<K,V>>
Specified by:
iterator in interface javax.cache.Cache<K,V>

loadAll

public void loadAll(Iterable<? extends K> keys,
                    boolean replaceExistingValues,
                    javax.cache.event.CompletionListener listener)
Specified by:
loadAll in interface javax.cache.Cache<K,V>

put

public void put(K key,
                V value)
Specified by:
put in interface javax.cache.Cache<K,V>

putAll

public void putAll(Map<? extends K,? extends V> inputMap)
Specified by:
putAll in interface javax.cache.Cache<K,V>

putIfAbsent

public boolean putIfAbsent(K key,
                           V value)
Specified by:
putIfAbsent in interface javax.cache.Cache<K,V>

registerCacheEntryListener

public boolean registerCacheEntryListener(javax.cache.event.CacheEntryListener<? super K,? super V> cacheEntryListener,
                                          boolean requireOldValue,
                                          javax.cache.event.CacheEntryEventFilter<? super K,? super V> cacheEntryFilter,
                                          boolean synchronous)
Specified by:
registerCacheEntryListener in interface javax.cache.Cache<K,V>

remove

public boolean remove(K key)
Specified by:
remove in interface javax.cache.Cache<K,V>

remove

public boolean remove(K key,
                      V oldValue)
Specified by:
remove in interface javax.cache.Cache<K,V>

removeAll

public void removeAll()
Specified by:
removeAll in interface javax.cache.Cache<K,V>

removeAll

public void removeAll(Set<? extends K> keys)
Specified by:
removeAll in interface javax.cache.Cache<K,V>

replace

public boolean replace(K key,
                       V value)
Specified by:
replace in interface javax.cache.Cache<K,V>

replace

public boolean replace(K key,
                       V oldValue,
                       V newValue)
Specified by:
replace in interface javax.cache.Cache<K,V>

unregisterCacheEntryListener

public boolean unregisterCacheEntryListener(javax.cache.event.CacheEntryListener<?,?> cacheEntryListener)
Specified by:
unregisterCacheEntryListener in interface javax.cache.Cache<K,V>

unwrap

public <T> T unwrap(Class<T> clazz)
Specified by:
unwrap in interface javax.cache.Cache<K,V>

-->

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.