org.infinispan
Class AbstractDelegatingAdvancedCache<K,V>

java.lang.Object
  extended by org.infinispan.AbstractDelegatingCache<K,V>
      extended by org.infinispan.AbstractDelegatingAdvancedCache<K,V>
All Implemented Interfaces:
ConcurrentMap<K,V>, Map<K,V>, AdvancedCache<K,V>, Cache<K,V>, Lifecycle, Listenable

public class AbstractDelegatingAdvancedCache<K,V>
extends AbstractDelegatingCache<K,V>
implements AdvancedCache<K,V>

Similar to AbstractDelegatingCache, but for AdvancedCache.

Author:
Mircea.Markus@jboss.com
See Also:
AbstractDelegatingCache

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
AbstractDelegatingAdvancedCache(AdvancedCache<K,V> cache)
           
 
Method Summary
 void addInterceptor(CommandInterceptor i, int position)
          Adds a custom interceptor to the interceptor chain, at specified position, where the first interceptor in the chain is at position 0 and the last one at NUM_INTERCEPTORS - 1.
 void addInterceptorAfter(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
          Adds a custom interceptor to the interceptor chain, after an instance of the specified interceptor type.
 void addInterceptorBefore(CommandInterceptor i, Class<? extends CommandInterceptor> beforeInterceptor)
          Adds a custom interceptor to the interceptor chain, before an instance of the specified interceptor type.
 void clear(Flag... flags)
           
 Future<Void> clearAsync()
          Asynchronous version of Map.clear().
 Future<Void> clearAsync(Flag... flags)
           
 boolean containsKey(Object key, Flag... flags)
           
 V get(Object key, Flag... flags)
           
 BatchContainer getBatchContainer()
           
 ComponentRegistry getComponentRegistry()
           
 DataContainer getDataContainer()
           
 EvictionManager getEvictionManager()
           
 List<CommandInterceptor> getInterceptorChain()
          Retrieves the current Interceptor chain.
 InvocationContextContainer getInvocationContextContainer()
           
 RpcManager getRpcManager()
           
 void lock(Collection<? extends K> keys)
           
 void lock(K key)
           
 V put(K key, V value, Flag... flags)
           
 V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
           
 void putAll(Map<? extends K,? extends V> map, Flag... flags)
           
 void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
           
 Future<Void> putAllAsync(Map<? extends K,? extends V> data)
          Asynchronous version of Map.putAll(Map).
 Future<Void> putAllAsync(Map<? extends K,? extends V> map, Flag... flags)
           
 Future<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit unit)
          Asynchronous version of Cache.putAll(Map, long, TimeUnit).
 Future<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
          Asynchronous version of Cache.putAll(Map, long, TimeUnit, long, TimeUnit).
 Future<Void> putAllAsync(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
           
 Future<V> putAsync(K key, V value)
          Asynchronous version of Map.put(Object, Object).
 Future<V> putAsync(K key, V value, Flag... flags)
           
 Future<V> putAsync(K key, V value, long lifespan, TimeUnit unit)
          Asynchronous version of Cache.put(Object, Object, long, TimeUnit) .
 Future<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
          Asynchronous version of Cache.put(Object, Object, long, TimeUnit, long, TimeUnit).
 Future<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
           
 void putForExternalRead(K key, V value, Flag... flags)
           
 V putIfAbsent(K key, V value, Flag... flags)
           
 V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
           
 Future<V> putIfAbsentAsync(K key, V value)
          Asynchronous version of ConcurrentMap.putIfAbsent(Object, Object).
 Future<V> putIfAbsentAsync(K key, V value, Flag... flags)
           
 Future<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit unit)
          Asynchronous version of Cache.putIfAbsent(Object, Object, long, TimeUnit) .
 Future<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
          Asynchronous version of Cache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit).
 Future<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
           
 V remove(Object key, Flag... flags)
           
 Future<V> removeAsync(Object key)
          Asynchronous version of Map.remove(Object).
 Future<V> removeAsync(Object key, Flag... flags)
           
 Future<Boolean> removeAsync(Object key, Object value)
          Asynchronous version of ConcurrentMap.remove(Object, Object).
 void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
          Removes the interceptor of specified type.
 void removeInterceptor(int position)
          Removes the interceptor at a specified position, where the first interceptor in the chain is at position 0 and the last one at getInterceptorChain().size() - 1.
 V replace(K k, V v, Flag... flags)
           
 V replace(K k, V v, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit, Flag... flags)
           
 boolean replace(K k, V oV, V nV, Flag... flags)
           
 boolean replace(K k, V oV, V nV, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit, Flag... flags)
           
 Future<V> replaceAsync(K key, V value)
          Asynchronous version of ConcurrentMap.replace(Object, Object).
 Future<V> replaceAsync(K k, V v, Flag... flags)
           
 Future<V> replaceAsync(K key, V value, long lifespan, TimeUnit unit)
          Asynchronous version of Cache.replace(Object, Object, long, TimeUnit).
 Future<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
          Asynchronous version of Cache.replace(Object, Object, long, TimeUnit, long, TimeUnit).
 Future<V> replaceAsync(K k, V v, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit, Flag... flags)
           
 Future<Boolean> replaceAsync(K key, V oldValue, V newValue)
          Asynchronous version of ConcurrentMap.replace(Object, Object, Object).
 Future<Boolean> replaceAsync(K k, V oV, V nV, Flag... flags)
           
 Future<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit unit)
          Asynchronous version of Cache.replace(Object, Object, Object, long, TimeUnit).
 Future<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
          Asynchronous version of Cache.replace(Object, Object, Object, long, TimeUnit, long, TimeUnit).
 Future<Boolean> replaceAsync(K k, V oV, V nV, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit, Flag... flags)
           
 void unlock(Collection<? extends K> keys)
           
 void unlock(K key)
           
 
Methods inherited from class org.infinispan.AbstractDelegatingCache
addListener, clear, compact, containsKey, containsValue, endBatch, entrySet, evict, get, getAdvancedCache, getCacheManager, getConfiguration, getListeners, getName, getStatus, getVersion, isEmpty, keySet, put, put, put, putAll, putAll, putAll, putForExternalRead, putIfAbsent, putIfAbsent, putIfAbsent, remove, remove, removeListener, replace, replace, replace, replace, replace, replace, size, start, startBatch, stop, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.Cache
compact, endBatch, evict, getAdvancedCache, getCacheManager, getConfiguration, getName, getStatus, getVersion, put, put, putAll, putAll, putForExternalRead, putIfAbsent, putIfAbsent, replace, replace, replace, replace, startBatch
 
Methods inherited from interface java.util.concurrent.ConcurrentMap
putIfAbsent, remove, replace, replace
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface org.infinispan.lifecycle.Lifecycle
start, stop
 
Methods inherited from interface org.infinispan.notifications.Listenable
addListener, getListeners, removeListener
 

Constructor Detail

AbstractDelegatingAdvancedCache

public AbstractDelegatingAdvancedCache(AdvancedCache<K,V> cache)
Method Detail

addInterceptor

public void addInterceptor(CommandInterceptor i,
                           int position)
Description copied from interface: AdvancedCache
Adds a custom interceptor to the interceptor chain, at specified position, where the first interceptor in the chain is at position 0 and the last one at NUM_INTERCEPTORS - 1.

Specified by:
addInterceptor in interface AdvancedCache<K,V>
Parameters:
i - the interceptor to add
position - the position to add the interceptor

addInterceptorAfter

public void addInterceptorAfter(CommandInterceptor i,
                                Class<? extends CommandInterceptor> afterInterceptor)
Description copied from interface: AdvancedCache
Adds a custom interceptor to the interceptor chain, after an instance of the specified interceptor type. Throws a cache exception if it cannot find an interceptor of the specified type.

Specified by:
addInterceptorAfter in interface AdvancedCache<K,V>
Parameters:
i - interceptor to add
afterInterceptor - interceptor type after which to place custom interceptor

addInterceptorBefore

public void addInterceptorBefore(CommandInterceptor i,
                                 Class<? extends CommandInterceptor> beforeInterceptor)
Description copied from interface: AdvancedCache
Adds a custom interceptor to the interceptor chain, before an instance of the specified interceptor type. Throws a cache exception if it cannot find an interceptor of the specified type.

Specified by:
addInterceptorBefore in interface AdvancedCache<K,V>
Parameters:
i - interceptor to add
beforeInterceptor - interceptor type before which to place custom interceptor

removeInterceptor

public void removeInterceptor(int position)
Description copied from interface: AdvancedCache
Removes the interceptor at a specified position, where the first interceptor in the chain is at position 0 and the last one at getInterceptorChain().size() - 1.

Specified by:
removeInterceptor in interface AdvancedCache<K,V>
Parameters:
position - the position at which to remove an interceptor

removeInterceptor

public void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
Description copied from interface: AdvancedCache
Removes the interceptor of specified type.

Specified by:
removeInterceptor in interface AdvancedCache<K,V>
Parameters:
interceptorType - type of interceptor to remove

getInterceptorChain

public List<CommandInterceptor> getInterceptorChain()
Description copied from interface: AdvancedCache
Retrieves the current Interceptor chain.

Specified by:
getInterceptorChain in interface AdvancedCache<K,V>
Returns:
an immutable List of CommandInterceptors configured for this cache

getEvictionManager

public EvictionManager getEvictionManager()
Specified by:
getEvictionManager in interface AdvancedCache<K,V>
Returns:
the eviction manager - if one is configured - for this cache instance

getComponentRegistry

public ComponentRegistry getComponentRegistry()
Specified by:
getComponentRegistry in interface AdvancedCache<K,V>
Returns:
the component registry for this cache instance

getRpcManager

public RpcManager getRpcManager()
Specified by:
getRpcManager in interface AdvancedCache<K,V>

getBatchContainer

public BatchContainer getBatchContainer()
Specified by:
getBatchContainer in interface AdvancedCache<K,V>

getInvocationContextContainer

public InvocationContextContainer getInvocationContextContainer()
Specified by:
getInvocationContextContainer in interface AdvancedCache<K,V>

getDataContainer

public DataContainer getDataContainer()
Specified by:
getDataContainer in interface AdvancedCache<K,V>

putForExternalRead

public void putForExternalRead(K key,
                               V value,
                               Flag... flags)
Specified by:
putForExternalRead in interface AdvancedCache<K,V>

put

public V put(K key,
             V value,
             Flag... flags)
Specified by:
put in interface AdvancedCache<K,V>

put

public V put(K key,
             V value,
             long lifespan,
             TimeUnit lifespanUnit,
             long maxIdleTime,
             TimeUnit maxIdleTimeUnit,
             Flag... flags)
Specified by:
put in interface AdvancedCache<K,V>

putIfAbsent

public V putIfAbsent(K key,
                     V value,
                     Flag... flags)
Specified by:
putIfAbsent in interface AdvancedCache<K,V>

putIfAbsent

public V putIfAbsent(K key,
                     V value,
                     long lifespan,
                     TimeUnit lifespanUnit,
                     long maxIdleTime,
                     TimeUnit maxIdleTimeUnit,
                     Flag... flags)
Specified by:
putIfAbsent in interface AdvancedCache<K,V>

putAll

public void putAll(Map<? extends K,? extends V> map,
                   Flag... flags)
Specified by:
putAll in interface AdvancedCache<K,V>

putAll

public void putAll(Map<? extends K,? extends V> map,
                   long lifespan,
                   TimeUnit lifespanUnit,
                   long maxIdleTime,
                   TimeUnit maxIdleTimeUnit,
                   Flag... flags)
Specified by:
putAll in interface AdvancedCache<K,V>

remove

public V remove(Object key,
                Flag... flags)
Specified by:
remove in interface AdvancedCache<K,V>

clear

public void clear(Flag... flags)
Specified by:
clear in interface AdvancedCache<K,V>

replace

public V replace(K k,
                 V v,
                 Flag... flags)
Specified by:
replace in interface AdvancedCache<K,V>

replace

public boolean replace(K k,
                       V oV,
                       V nV,
                       Flag... flags)
Specified by:
replace in interface AdvancedCache<K,V>

replace

public V replace(K k,
                 V v,
                 long lifespan,
                 TimeUnit lifespanUnit,
                 long maxIdle,
                 TimeUnit maxIdleUnit,
                 Flag... flags)
Specified by:
replace in interface AdvancedCache<K,V>

replace

public boolean replace(K k,
                       V oV,
                       V nV,
                       long lifespan,
                       TimeUnit lifespanUnit,
                       long maxIdle,
                       TimeUnit maxIdleUnit,
                       Flag... flags)
Specified by:
replace in interface AdvancedCache<K,V>

putAsync

public Future<V> putAsync(K key,
                          V value,
                          Flag... flags)
Specified by:
putAsync in interface AdvancedCache<K,V>

putAsync

public Future<V> putAsync(K key,
                          V value,
                          long lifespan,
                          TimeUnit lifespanUnit,
                          long maxIdleTime,
                          TimeUnit maxIdleTimeUnit,
                          Flag... flags)
Specified by:
putAsync in interface AdvancedCache<K,V>

putIfAbsentAsync

public Future<V> putIfAbsentAsync(K key,
                                  V value,
                                  Flag... flags)
Specified by:
putIfAbsentAsync in interface AdvancedCache<K,V>

putIfAbsentAsync

public Future<V> putIfAbsentAsync(K key,
                                  V value,
                                  long lifespan,
                                  TimeUnit lifespanUnit,
                                  long maxIdleTime,
                                  TimeUnit maxIdleTimeUnit,
                                  Flag... flags)
Specified by:
putIfAbsentAsync in interface AdvancedCache<K,V>

putAllAsync

public Future<Void> putAllAsync(Map<? extends K,? extends V> map,
                                Flag... flags)
Specified by:
putAllAsync in interface AdvancedCache<K,V>

putAllAsync

public Future<Void> putAllAsync(Map<? extends K,? extends V> map,
                                long lifespan,
                                TimeUnit lifespanUnit,
                                long maxIdleTime,
                                TimeUnit maxIdleTimeUnit,
                                Flag... flags)
Specified by:
putAllAsync in interface AdvancedCache<K,V>

removeAsync

public Future<V> removeAsync(Object key,
                             Flag... flags)
Specified by:
removeAsync in interface AdvancedCache<K,V>

clearAsync

public Future<Void> clearAsync(Flag... flags)
Specified by:
clearAsync in interface AdvancedCache<K,V>

replaceAsync

public Future<V> replaceAsync(K k,
                              V v,
                              Flag... flags)
Specified by:
replaceAsync in interface AdvancedCache<K,V>

replaceAsync

public Future<Boolean> replaceAsync(K k,
                                    V oV,
                                    V nV,
                                    Flag... flags)
Specified by:
replaceAsync in interface AdvancedCache<K,V>

replaceAsync

public Future<V> replaceAsync(K k,
                              V v,
                              long lifespan,
                              TimeUnit lifespanUnit,
                              long maxIdle,
                              TimeUnit maxIdleUnit,
                              Flag... flags)
Specified by:
replaceAsync in interface AdvancedCache<K,V>

replaceAsync

public Future<Boolean> replaceAsync(K k,
                                    V oV,
                                    V nV,
                                    long lifespan,
                                    TimeUnit lifespanUnit,
                                    long maxIdle,
                                    TimeUnit maxIdleUnit,
                                    Flag... flags)
Specified by:
replaceAsync in interface AdvancedCache<K,V>

containsKey

public boolean containsKey(Object key,
                           Flag... flags)
Specified by:
containsKey in interface AdvancedCache<K,V>

get

public V get(Object key,
             Flag... flags)
Specified by:
get in interface AdvancedCache<K,V>

putAsync

public Future<V> putAsync(K key,
                          V value)
Description copied from interface: Cache
Asynchronous version of Map.put(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Map.put(Object, Object) if used in LOCAL mode.

Specified by:
putAsync in interface Cache<K,V>
Parameters:
key - key to use
value - value to store
Returns:
a future containing the old value replaced.

putAsync

public Future<V> putAsync(K key,
                          V value,
                          long lifespan,
                          TimeUnit unit)
Description copied from interface: Cache
Asynchronous version of Cache.put(Object, Object, long, TimeUnit) . This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.put(Object, Object, long, TimeUnit) if used in LOCAL mode.

Specified by:
putAsync in interface Cache<K,V>
Parameters:
key - key to use
value - value to store
lifespan - lifespan of entry
unit - time unit for lifespan
Returns:
a future containing the old value replaced

putAsync

public Future<V> putAsync(K key,
                          V value,
                          long lifespan,
                          TimeUnit lifespanUnit,
                          long maxIdle,
                          TimeUnit maxIdleUnit)
Description copied from interface: Cache
Asynchronous version of Cache.put(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.put(Object, Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.

Specified by:
putAsync in interface Cache<K,V>
Parameters:
key - key to use
value - value to store
lifespan - lifespan of entry
lifespanUnit - time unit for lifespan
maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleUnit - time unit for max idle time
Returns:
a future containing the old value replaced

putAllAsync

public Future<Void> putAllAsync(Map<? extends K,? extends V> data)
Description copied from interface: Cache
Asynchronous version of Map.putAll(Map). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Map.putAll(Map) if used in LOCAL mode.

Specified by:
putAllAsync in interface Cache<K,V>
Parameters:
data - to store
Returns:
a future containing a void return type

putAllAsync

public Future<Void> putAllAsync(Map<? extends K,? extends V> data,
                                long lifespan,
                                TimeUnit unit)
Description copied from interface: Cache
Asynchronous version of Cache.putAll(Map, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.putAll(Map, long, TimeUnit) if used in LOCAL mode.

Specified by:
putAllAsync in interface Cache<K,V>
Parameters:
data - to store
lifespan - lifespan of entry
unit - time unit for lifespan
Returns:
a future containing a void return type

putAllAsync

public Future<Void> putAllAsync(Map<? extends K,? extends V> data,
                                long lifespan,
                                TimeUnit lifespanUnit,
                                long maxIdle,
                                TimeUnit maxIdleUnit)
Description copied from interface: Cache
Asynchronous version of Cache.putAll(Map, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.putAll(Map, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.

Specified by:
putAllAsync in interface Cache<K,V>
Parameters:
data - to store
lifespan - lifespan of entry
lifespanUnit - time unit for lifespan
maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleUnit - time unit for max idle time
Returns:
a future containing a void return type

clearAsync

public Future<Void> clearAsync()
Description copied from interface: Cache
Asynchronous version of Map.clear(). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Map.clear() if used in LOCAL mode.

Specified by:
clearAsync in interface Cache<K,V>
Returns:
a future containing a void return type

putIfAbsentAsync

public Future<V> putIfAbsentAsync(K key,
                                  V value)
Description copied from interface: Cache
Asynchronous version of ConcurrentMap.putIfAbsent(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over ConcurrentMap.putIfAbsent(Object, Object) if used in LOCAL mode.

Specified by:
putIfAbsentAsync in interface Cache<K,V>
Parameters:
key - key to use
value - value to store
Returns:
a future containing the old value replaced.

putIfAbsentAsync

public Future<V> putIfAbsentAsync(K key,
                                  V value,
                                  long lifespan,
                                  TimeUnit unit)
Description copied from interface: Cache
Asynchronous version of Cache.putIfAbsent(Object, Object, long, TimeUnit) . This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.putIfAbsent(Object, Object, long, TimeUnit) if used in LOCAL mode.

Specified by:
putIfAbsentAsync in interface Cache<K,V>
Parameters:
key - key to use
value - value to store
lifespan - lifespan of entry
unit - time unit for lifespan
Returns:
a future containing the old value replaced

putIfAbsentAsync

public Future<V> putIfAbsentAsync(K key,
                                  V value,
                                  long lifespan,
                                  TimeUnit lifespanUnit,
                                  long maxIdle,
                                  TimeUnit maxIdleUnit)
Description copied from interface: Cache
Asynchronous version of Cache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.

Specified by:
putIfAbsentAsync in interface Cache<K,V>
Parameters:
key - key to use
value - value to store
lifespan - lifespan of entry
lifespanUnit - time unit for lifespan
maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleUnit - time unit for max idle time
Returns:
a future containing the old value replaced

removeAsync

public Future<V> removeAsync(Object key)
Description copied from interface: Cache
Asynchronous version of Map.remove(Object). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Map.remove(Object) if used in LOCAL mode.

Specified by:
removeAsync in interface Cache<K,V>
Parameters:
key - key to remove
Returns:
a future containing the value removed

removeAsync

public Future<Boolean> removeAsync(Object key,
                                   Object value)
Description copied from interface: Cache
Asynchronous version of ConcurrentMap.remove(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over ConcurrentMap.remove(Object, Object) if used in LOCAL mode.

Specified by:
removeAsync in interface Cache<K,V>
Parameters:
key - key to remove
value - value to match on
Returns:
a future containing a boolean, indicating whether the entry was removed or not

replaceAsync

public Future<V> replaceAsync(K key,
                              V value)
Description copied from interface: Cache
Asynchronous version of ConcurrentMap.replace(Object, Object). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over ConcurrentMap.replace(Object, Object) if used in LOCAL mode.

Specified by:
replaceAsync in interface Cache<K,V>
Parameters:
key - key to remove
value - value to store
Returns:
a future containing the previous value overwritten

replaceAsync

public Future<V> replaceAsync(K key,
                              V value,
                              long lifespan,
                              TimeUnit unit)
Description copied from interface: Cache
Asynchronous version of Cache.replace(Object, Object, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.replace(Object, Object, long, TimeUnit) if used in LOCAL mode.

Specified by:
replaceAsync in interface Cache<K,V>
Parameters:
key - key to remove
value - value to store
lifespan - lifespan of entry
unit - time unit for lifespan
Returns:
a future containing the previous value overwritten

replaceAsync

public Future<V> replaceAsync(K key,
                              V value,
                              long lifespan,
                              TimeUnit lifespanUnit,
                              long maxIdle,
                              TimeUnit maxIdleUnit)
Description copied from interface: Cache
Asynchronous version of Cache.replace(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.replace(Object, Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.

Specified by:
replaceAsync in interface Cache<K,V>
Parameters:
key - key to remove
value - value to store
lifespan - lifespan of entry
lifespanUnit - time unit for lifespan
maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleUnit - time unit for max idle time
Returns:
a future containing the previous value overwritten

replaceAsync

public Future<Boolean> replaceAsync(K key,
                                    V oldValue,
                                    V newValue)
Description copied from interface: Cache
Asynchronous version of ConcurrentMap.replace(Object, Object, Object). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over ConcurrentMap.replace(Object, Object, Object) if used in LOCAL mode.

Specified by:
replaceAsync in interface Cache<K,V>
Parameters:
key - key to remove
oldValue - value to overwrite
newValue - value to store
Returns:
a future containing a boolean, indicating whether the entry was replaced or not

replaceAsync

public Future<Boolean> replaceAsync(K key,
                                    V oldValue,
                                    V newValue,
                                    long lifespan,
                                    TimeUnit unit)
Description copied from interface: Cache
Asynchronous version of Cache.replace(Object, Object, Object, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.replace(Object, Object, Object, long, TimeUnit) if used in LOCAL mode.

Specified by:
replaceAsync in interface Cache<K,V>
Parameters:
key - key to remove
oldValue - value to overwrite
newValue - value to store
lifespan - lifespan of entry
unit - time unit for lifespan
Returns:
a future containing a boolean, indicating whether the entry was replaced or not

replaceAsync

public Future<Boolean> replaceAsync(K key,
                                    V oldValue,
                                    V newValue,
                                    long lifespan,
                                    TimeUnit lifespanUnit,
                                    long maxIdle,
                                    TimeUnit maxIdleUnit)
Description copied from interface: Cache
Asynchronous version of Cache.replace(Object, Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.replace(Object, Object, Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.

Specified by:
replaceAsync in interface Cache<K,V>
Parameters:
key - key to remove
oldValue - value to overwrite
newValue - value to store
lifespan - lifespan of entry
lifespanUnit - time unit for lifespan
maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleUnit - time unit for max idle time
Returns:
a future containing a boolean, indicating whether the entry was replaced or not

lock

public void lock(K key)
Specified by:
lock in interface AdvancedCache<K,V>

lock

public void lock(Collection<? extends K> keys)
Specified by:
lock in interface AdvancedCache<K,V>

unlock

public void unlock(K key)
Specified by:
unlock in interface AdvancedCache<K,V>

unlock

public void unlock(Collection<? extends K> keys)
Specified by:
unlock in interface AdvancedCache<K,V>


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