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 abstract 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.
 BatchContainer getBatchContainer()
           
 ComponentRegistry getComponentRegistry()
           
 DataContainer getDataContainer()
           
 DistributionManager getDistributionManager()
          Retrieves a reference to the DistributionManager if the cache is configured to use Distribution.
 EvictionManager getEvictionManager()
           
 List<CommandInterceptor> getInterceptorChain()
          Retrieves the current Interceptor chain.
 InvocationContextContainer getInvocationContextContainer()
           
 RpcManager getRpcManager()
           
 TransactionManager getTransactionManager()
           
 void lock(Collection<? extends K> keys)
          Locks collections of keys eagerly across cache nodes in a cluster.
 void lock(K key)
          Locks a given key eagerly across cache nodes in a cluster.
 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.
 AdvancedCache<K,V> withFlags(Flag... flags)
          A builder-style method that adds flags to any API call.
 
Methods inherited from class org.infinispan.AbstractDelegatingCache
addListener, clear, clearAsync, compact, containsKey, containsValue, endBatch, entrySet, evict, get, getAdvancedCache, getCacheManager, getConfiguration, getListeners, getName, getStatus, getVersion, isEmpty, keySet, put, put, put, putAll, putAll, putAll, putAllAsync, putAllAsync, putAllAsync, putAsync, putAsync, putAsync, putForExternalRead, putIfAbsent, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, putIfAbsentAsync, remove, remove, removeAsync, removeAsync, removeListener, replace, replace, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, 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.AdvancedCache
getStats
 
Methods inherited from interface org.infinispan.Cache
clearAsync, compact, endBatch, entrySet, evict, getAdvancedCache, getCacheManager, getConfiguration, getName, getStatus, getVersion, keySet, 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, values
 
Methods inherited from interface java.util.concurrent.ConcurrentMap
putIfAbsent, remove, replace, replace
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size
 
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

getDistributionManager

public DistributionManager getDistributionManager()
Description copied from interface: AdvancedCache
Retrieves a reference to the DistributionManager if the cache is configured to use Distribution. Otherwise, returns a null.

Specified by:
getDistributionManager in interface AdvancedCache<K,V>
Returns:
a DistributionManager, or null.

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>

getTransactionManager

public TransactionManager getTransactionManager()
Specified by:
getTransactionManager in interface AdvancedCache<K,V>

withFlags

public AdvancedCache<K,V> withFlags(Flag... flags)
Description copied from interface: AdvancedCache
A builder-style method that adds flags to any API call. For example, consider the following code snippet:
   cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);
 
will invoke a cache.get() with a write lock forced.

Specified by:
withFlags in interface AdvancedCache<K,V>
Parameters:
flags - a set of flags to apply. See the Flag documentation.
Returns:
a cache on which a real operation is to be invoked.

lock

public void lock(K key)
Description copied from interface: AdvancedCache
Locks a given key eagerly across cache nodes in a cluster.

A key can be locked eagerly in the context of a transaction only

Specified by:
lock in interface AdvancedCache<K,V>
Parameters:
key - the key to lock

lock

public void lock(Collection<? extends K> keys)
Description copied from interface: AdvancedCache
Locks collections of keys eagerly across cache nodes in a cluster.

Collections of keys can be locked eagerly in the context of a transaction only

Specified by:
lock in interface AdvancedCache<K,V>
Parameters:
keys - collection of keys to lock

Google Analytics

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