com.caucho.distcache
Interface ObjectCache<K,V>

All Superinterfaces:
Cache<K,V>, CacheLifecycle, java.lang.Iterable<Cache.Entry<K,V>>
All Known Implementing Classes:
AbstractCache, CacheImpl, ClusterCache, LocalCache, TransientCache

public interface ObjectCache<K,V>
extends Cache<K,V>

Interface for a distributed cache.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.cache.Cache
Cache.Entry<K,V>, Cache.EntryProcessor<K,V>, Cache.MutableEntry<K,V>
 
Method Summary
 boolean compareAndPut(K key, long version, java.lang.Object value)
          Updates the cache if the old value hash matches the current value.
 boolean compareAndRemove(K key, long version)
          Removes the entry from the cache if the current entry's version matches.
 V getExact(K key)
           
 ExtCacheEntry<K,V> getExtCacheEntry(K key)
          Returns the extended entry
 ExtCacheEntry<K,V> getStatCacheEntry(K key)
           
 boolean isClosed()
          Returns true if the cache is closed
 
Methods inherited from interface javax.cache.Cache
containsKey, get, getAll, getAndPut, getAndRemove, getAndReplace, getCacheManager, getConfiguration, getMBean, getName, getStatistics, invokeEntryProcessor, iterator, load, loadAll, put, putAll, putIfAbsent, registerCacheEntryListener, remove, remove, removeAll, removeAll, replace, replace, unregisterCacheEntryListener, unwrap
 
Methods inherited from interface javax.cache.CacheLifecycle
getStatus, start, stop
 

Method Detail

getExtCacheEntry

ExtCacheEntry<K,V> getExtCacheEntry(K key)
Returns the extended entry


getExact

V getExact(K key)

compareAndPut

boolean compareAndPut(K key,
                      long version,
                      java.lang.Object value)
Updates the cache if the old value hash matches the current value. A null value for the old value hash only adds the entry if it's new

Parameters:
key - the key to compare
version - the version of the old value returned by getEntry
value - the new value
Returns:
true if the update succeeds, false if it fails

compareAndRemove

boolean compareAndRemove(K key,
                         long version)
Removes the entry from the cache if the current entry's version matches.


isClosed

boolean isClosed()
Returns true if the cache is closed


getStatCacheEntry

ExtCacheEntry<K,V> getStatCacheEntry(K key)