org.infinispan
Interface AdvancedCache<K,V>

All Superinterfaces:
Cache<K,V>, ConcurrentMap<K,V>, Lifecycle, Listenable, Map<K,V>
All Known Implementing Classes:
AbstractDelegatingAdvancedCache, CacheDelegate

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

An advanced interface that exposes additional methods not available on Cache.

Since:
4.0
Author:
Manik Surtani

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
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(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> map, Flag... flags)
           
 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, Flag... flags)
           
 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, Flag... flags)
           
 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, Flag... flags)
           
 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 k, V v, Flag... flags)
           
 Future<V> replaceAsync(K k, V v, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit, Flag... flags)
           
 Future<Boolean> replaceAsync(K k, V oV, V nV, Flag... flags)
           
 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 interface org.infinispan.Cache
clearAsync, compact, endBatch, evict, getAdvancedCache, getCacheManager, getConfiguration, getName, getStatus, getVersion, put, put, putAll, putAll, putAllAsync, putAllAsync, putAllAsync, putAsync, putAsync, putAsync, putForExternalRead, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, putIfAbsentAsync, removeAsync, removeAsync, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, 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
 

Method Detail

addInterceptor

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.

Parameters:
i - the interceptor to add
position - the position to add the interceptor

addInterceptorAfter

void addInterceptorAfter(CommandInterceptor i,
                         Class<? extends CommandInterceptor> afterInterceptor)
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.

Parameters:
i - interceptor to add
afterInterceptor - interceptor type after which to place custom interceptor

addInterceptorBefore

void addInterceptorBefore(CommandInterceptor i,
                          Class<? extends CommandInterceptor> beforeInterceptor)
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.

Parameters:
i - interceptor to add
beforeInterceptor - interceptor type before which to place custom interceptor

removeInterceptor

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.

Parameters:
position - the position at which to remove an interceptor

removeInterceptor

void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
Removes the interceptor of specified type.

Parameters:
interceptorType - type of interceptor to remove

getInterceptorChain

List<CommandInterceptor> getInterceptorChain()
Retrieves the current Interceptor chain.

Returns:
an immutable List of CommandInterceptors configured for this cache

getEvictionManager

EvictionManager getEvictionManager()
Returns:
the eviction manager - if one is configured - for this cache instance

getComponentRegistry

ComponentRegistry getComponentRegistry()
Returns:
the component registry for this cache instance

lock

void lock(K key)

lock

void lock(Collection<? extends K> keys)

unlock

void unlock(K key)

unlock

void unlock(Collection<? extends K> keys)

getRpcManager

RpcManager getRpcManager()

getBatchContainer

BatchContainer getBatchContainer()

getInvocationContextContainer

InvocationContextContainer getInvocationContextContainer()

getDataContainer

DataContainer getDataContainer()

putForExternalRead

void putForExternalRead(K key,
                        V value,
                        Flag... flags)

put

V put(K key,
      V value,
      Flag... flags)

put

V put(K key,
      V value,
      long lifespan,
      TimeUnit lifespanUnit,
      long maxIdleTime,
      TimeUnit maxIdleTimeUnit,
      Flag... flags)

putIfAbsent

V putIfAbsent(K key,
              V value,
              Flag... flags)

putIfAbsent

V putIfAbsent(K key,
              V value,
              long lifespan,
              TimeUnit lifespanUnit,
              long maxIdleTime,
              TimeUnit maxIdleTimeUnit,
              Flag... flags)

putAll

void putAll(Map<? extends K,? extends V> map,
            Flag... flags)

putAll

void putAll(Map<? extends K,? extends V> map,
            long lifespan,
            TimeUnit lifespanUnit,
            long maxIdleTime,
            TimeUnit maxIdleTimeUnit,
            Flag... flags)

remove

V remove(Object key,
         Flag... flags)

clear

void clear(Flag... flags)

replace

V replace(K k,
          V v,
          Flag... flags)

replace

boolean replace(K k,
                V oV,
                V nV,
                Flag... flags)

replace

V replace(K k,
          V v,
          long lifespan,
          TimeUnit lifespanUnit,
          long maxIdle,
          TimeUnit maxIdleUnit,
          Flag... flags)

replace

boolean replace(K k,
                V oV,
                V nV,
                long lifespan,
                TimeUnit lifespanUnit,
                long maxIdle,
                TimeUnit maxIdleUnit,
                Flag... flags)

putAsync

Future<V> putAsync(K key,
                   V value,
                   Flag... flags)

putAsync

Future<V> putAsync(K key,
                   V value,
                   long lifespan,
                   TimeUnit lifespanUnit,
                   long maxIdleTime,
                   TimeUnit maxIdleTimeUnit,
                   Flag... flags)

putIfAbsentAsync

Future<V> putIfAbsentAsync(K key,
                           V value,
                           Flag... flags)

putIfAbsentAsync

Future<V> putIfAbsentAsync(K key,
                           V value,
                           long lifespan,
                           TimeUnit lifespanUnit,
                           long maxIdleTime,
                           TimeUnit maxIdleTimeUnit,
                           Flag... flags)

putAllAsync

Future<Void> putAllAsync(Map<? extends K,? extends V> map,
                         Flag... flags)

putAllAsync

Future<Void> putAllAsync(Map<? extends K,? extends V> map,
                         long lifespan,
                         TimeUnit lifespanUnit,
                         long maxIdleTime,
                         TimeUnit maxIdleTimeUnit,
                         Flag... flags)

removeAsync

Future<V> removeAsync(Object key,
                      Flag... flags)

clearAsync

Future<Void> clearAsync(Flag... flags)

replaceAsync

Future<V> replaceAsync(K k,
                       V v,
                       Flag... flags)

replaceAsync

Future<Boolean> replaceAsync(K k,
                             V oV,
                             V nV,
                             Flag... flags)

replaceAsync

Future<V> replaceAsync(K k,
                       V v,
                       long lifespan,
                       TimeUnit lifespanUnit,
                       long maxIdle,
                       TimeUnit maxIdleUnit,
                       Flag... flags)

replaceAsync

Future<Boolean> replaceAsync(K k,
                             V oV,
                             V nV,
                             long lifespan,
                             TimeUnit lifespanUnit,
                             long maxIdle,
                             TimeUnit maxIdleUnit,
                             Flag... flags)

containsKey

boolean containsKey(Object key,
                    Flag... flags)

get

V get(Object key,
      Flag... flags)


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