|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.infinispan.CacheSupport<K,V> org.infinispan.CacheImpl<K,V>
public class CacheImpl<K,V>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected BatchContainer |
batchContainer
|
protected CommandsFactory |
commandsFactory
|
protected ComponentRegistry |
componentRegistry
|
protected Configuration |
config
|
protected InvocationContextContainer |
icc
|
protected InterceptorChain |
invoker
|
protected StreamingMarshaller |
marshaller
|
protected CacheNotifier |
notifier
|
static String |
OBJECT_NAME
|
protected RpcManager |
rpcManager
|
protected TransactionManager |
transactionManager
|
Fields inherited from class org.infinispan.CacheSupport |
---|
defaultLifespan, defaultMaxIdleTime |
Constructor Summary | |
---|---|
CacheImpl(String name)
|
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 |
addListener(Object listener)
Adds a listener to the component. |
void |
clear()
|
NotifyingFuture<Void> |
clearAsync()
Asynchronous version of Map.clear() . |
void |
compact()
Method that releases object references of cached objects held in the cache by serializing them to byte buffers. |
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
void |
endBatch(boolean successful)
Completes a batch if one has been started using Cache.startBatch() . |
Set<Map.Entry<K,V>> |
entrySet()
Returns a set view of the mappings contained in this cache. |
void |
evict(K key)
Evicts an entry from the memory of the cache. |
V |
get(Object key)
|
AdvancedCache<K,V> |
getAdvancedCache()
|
NotifyingFuture<V> |
getAsync(K key)
Asynchronous version of Map.get(Object) that allows user code to
retrieve the value associated with a key at a later stage, hence allowing
multiple parallel get requests to be sent. |
BatchContainer |
getBatchContainer()
|
EmbeddedCacheManager |
getCacheManager()
Retrieves the cache manager responsible for creating this cache instance. |
String |
getCacheName()
Returns the cache name. |
String |
getCacheStatus()
Returns String representation of ComponentStatus enumeration in order to avoid class not found exceptions in JMX tools that don't have access to infinispan classes. |
ClassLoader |
getClassLoader()
|
ComponentRegistry |
getComponentRegistry()
|
Configuration |
getConfiguration()
|
String |
getConfigurationAsXmlString()
Returns the cache configuration as XML string. |
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()
|
Set<Object> |
getListeners()
|
LockManager |
getLockManager()
|
String |
getName()
Retrieves the name of the cache |
RpcManager |
getRpcManager()
|
Stats |
getStats()
|
ComponentStatus |
getStatus()
|
TransactionManager |
getTransactionManager()
|
String |
getVersion()
Retrieves the version of Infinispan |
XAResource |
getXAResource()
Returns an Infinispan XAResource implementation. |
void |
injectDependencies(EvictionManager evictionManager,
InvocationContextContainer icc,
CommandsFactory commandsFactory,
InterceptorChain interceptorChain,
Configuration configuration,
CacheNotifier notifier,
ComponentRegistry componentRegistry,
TransactionManager transactionManager,
BatchContainer batchContainer,
RpcManager rpcManager,
DataContainer dataContainer,
StreamingMarshaller marshaller,
ResponseGenerator responseGenerator,
DistributionManager distributionManager,
EmbeddedCacheManager cacheManager,
StateTransferManager stateTransferManager,
ExecutorService asyncExecutor,
TransactionTable txTable,
RecoveryManager recoveryManager,
TransactionCoordinator txCoordinator,
LockManager lockManager)
|
boolean |
isEmpty()
|
Set<K> |
keySet()
Returns a set view of the keys contained in this cache. |
boolean |
lock(Collection<? extends K> keys)
Locks collections of keys eagerly across cache nodes in a cluster. |
boolean |
lock(K... keys)
Locks a given key or keys eagerly across cache nodes in a cluster. |
V |
put(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of Map.put(Object, Object) , which takes in lifespan parameters. |
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of Map.putAll(Map) , which takes in lifespan parameters. |
NotifyingFuture<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) . |
NotifyingFuture<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) . |
void |
putForExternalRead(K key,
V value)
Under special operating behavior, associates the value with the specified key. |
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of ConcurrentMap.putIfAbsent(Object, Object) , which takes in lifespan parameters. |
NotifyingFuture<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) . |
V |
remove(Object key)
|
boolean |
remove(Object key,
Object value)
|
NotifyingFuture<V> |
removeAsync(Object key)
Asynchronous version of Map.remove(Object) . |
NotifyingFuture<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. |
void |
removeListener(Object listener)
Removes a listener from the component. |
V |
replace(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of ConcurrentMap.replace(Object, Object) , which takes in lifespan parameters. |
boolean |
replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of ConcurrentMap.replace(Object, Object, Object) , which takes in lifespan parameters. |
NotifyingFuture<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) . |
NotifyingFuture<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) . |
protected void |
set(K key,
V value)
This is intentionally a non-public method meant as an integration point for bytecode manipulation. |
int |
size()
|
void |
start()
|
boolean |
startBatch()
Starts a batch. |
void |
stop()
|
String |
toString()
|
Collection<V> |
values()
Returns a collection view of the values contained in this cache. |
AdvancedCache<K,V> |
with(ClassLoader classLoader)
|
AdvancedCache<K,V> |
withFlags(Flag... flags)
A builder-style method that adds flags to any API call. |
Methods inherited from class org.infinispan.CacheSupport |
---|
put, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.infinispan.Cache |
---|
put, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync |
Methods inherited from interface java.util.concurrent.ConcurrentMap |
---|
putIfAbsent, replace, replace |
Methods inherited from interface java.util.Map |
---|
equals, hashCode, put, putAll |
Field Detail |
---|
public static final String OBJECT_NAME
protected InvocationContextContainer icc
protected CommandsFactory commandsFactory
protected InterceptorChain invoker
protected Configuration config
protected CacheNotifier notifier
protected BatchContainer batchContainer
protected ComponentRegistry componentRegistry
protected TransactionManager transactionManager
protected RpcManager rpcManager
protected StreamingMarshaller marshaller
Constructor Detail |
---|
public CacheImpl(String name)
Method Detail |
---|
public void injectDependencies(EvictionManager evictionManager, InvocationContextContainer icc, CommandsFactory commandsFactory, InterceptorChain interceptorChain, Configuration configuration, CacheNotifier notifier, ComponentRegistry componentRegistry, TransactionManager transactionManager, BatchContainer batchContainer, RpcManager rpcManager, DataContainer dataContainer, StreamingMarshaller marshaller, ResponseGenerator responseGenerator, DistributionManager distributionManager, EmbeddedCacheManager cacheManager, StateTransferManager stateTransferManager, ExecutorService asyncExecutor, TransactionTable txTable, RecoveryManager recoveryManager, TransactionCoordinator txCoordinator, LockManager lockManager)
public final boolean remove(Object key, Object value)
remove
in interface ConcurrentMap<K,V>
public final int size()
size
in interface Map<K,V>
public final boolean isEmpty()
isEmpty
in interface Map<K,V>
public final boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public final boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public final V get(Object key)
get
in interface Map<K,V>
public final V remove(Object key)
remove
in interface Map<K,V>
public final void clear()
clear
in interface Map<K,V>
public Set<K> keySet()
Cache
keySet
in interface Map<K,V>
keySet
in interface Cache<K,V>
public Collection<V> values()
Cache
values
in interface Map<K,V>
values
in interface Cache<K,V>
public Set<Map.Entry<K,V>> entrySet()
Cache
Map.Entry
. When this method is called on a cache configured with distribution mode, the set returned only
contains the mappings locally available in the cache instance. To avoid memory issues, there will be not attempt
to bring mappings from other nodes.
This method should only be used for debugging purposes such as to verify that the cache contains all the mappings
entered. Any other use involving execution of this method on a production system is not recommended.
entrySet
in interface Map<K,V>
entrySet
in interface Cache<K,V>
public final void putForExternalRead(K key, V value)
Cache
ConcurrentMap.putIfAbsent(Object, Object)
)
putForExternalRead
in interface Cache<K,V>
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.public final void evict(K key)
Cache
Map.remove(Object)
to remove an
entry from the entire cache system.
This method is designed to evict an entry from memory to free up memory used by the application. This method uses
a 0 lock acquisition timeout so it does not block in attempting to acquire locks. It behaves as a no-op if the
lock on the entry cannot be acquired immediately.
Important: this method should not be called from within a transaction scope.
evict
in interface Cache<K,V>
key
- key to evictpublic Configuration getConfiguration()
getConfiguration
in interface Cache<K,V>
public void addListener(Object listener)
Listenable
Listener
and
further to that, contain methods annotated appropriately, otherwise the listener will not be registered.
See the Listener
annotation for more information.
addListener
in interface Listenable
listener
- must not be null.public void removeListener(Object listener)
Listenable
removeListener
in interface Listenable
listener
- listener to remove. Must not be null.public Set<Object> getListeners()
getListeners
in interface Listenable
public boolean lock(K... keys)
AdvancedCache
Keys can be locked eagerly in the context of a transaction only
lock
in interface AdvancedCache<K,V>
keys
- the keys to lock
public boolean lock(Collection<? extends K> keys)
AdvancedCache
Collections of keys can be locked eagerly in the context of a transaction only
lock
in interface AdvancedCache<K,V>
keys
- collection of keys to lock
public void start()
start
in interface Lifecycle
public void stop()
stop
in interface Lifecycle
public List<CommandInterceptor> getInterceptorChain()
AdvancedCache
getInterceptorChain
in interface AdvancedCache<K,V>
List
of CommandInterceptor
s
configured for this cachepublic void addInterceptor(CommandInterceptor i, int position)
AdvancedCache
addInterceptor
in interface AdvancedCache<K,V>
i
- the interceptor to addposition
- the position to add the interceptorpublic void addInterceptorAfter(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
AdvancedCache
addInterceptorAfter
in interface AdvancedCache<K,V>
i
- interceptor to addafterInterceptor
- interceptor type after which to place custom interceptorpublic void addInterceptorBefore(CommandInterceptor i, Class<? extends CommandInterceptor> beforeInterceptor)
AdvancedCache
addInterceptorBefore
in interface AdvancedCache<K,V>
i
- interceptor to addbeforeInterceptor
- interceptor type before which to place custom interceptorpublic void removeInterceptor(int position)
AdvancedCache
removeInterceptor
in interface AdvancedCache<K,V>
position
- the position at which to remove an interceptorpublic void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
AdvancedCache
removeInterceptor
in interface AdvancedCache<K,V>
interceptorType
- type of interceptor to removepublic EvictionManager getEvictionManager()
getEvictionManager
in interface AdvancedCache<K,V>
public ComponentRegistry getComponentRegistry()
getComponentRegistry
in interface AdvancedCache<K,V>
public DistributionManager getDistributionManager()
AdvancedCache
DistributionManager
if the cache is configured
to use Distribution. Otherwise, returns a null.
getDistributionManager
in interface AdvancedCache<K,V>
public ComponentStatus getStatus()
getStatus
in interface Cache<K,V>
public String getCacheStatus()
public boolean startBatch()
Cache
startBatch
in interface Cache<K,V>
public void endBatch(boolean successful)
Cache
Cache.startBatch()
. If no batch has been started, this is a
no-op.
endBatch
in interface Cache<K,V>
successful
- if true, the batch completes, otherwise the batch is aborted and changes are not committed.public String getName()
Cache
getName
in interface Cache<K,V>
public String getCacheName()
public String getConfigurationAsXmlString()
public String getVersion()
Cache
getVersion
in interface Cache<K,V>
public String toString()
toString
in class Object
public BatchContainer getBatchContainer()
getBatchContainer
in interface AdvancedCache<K,V>
public InvocationContextContainer getInvocationContextContainer()
getInvocationContextContainer
in interface AdvancedCache<K,V>
public DataContainer getDataContainer()
getDataContainer
in interface AdvancedCache<K,V>
public TransactionManager getTransactionManager()
getTransactionManager
in interface AdvancedCache<K,V>
public LockManager getLockManager()
getLockManager
in interface AdvancedCache<K,V>
public EmbeddedCacheManager getCacheManager()
Cache
getCacheManager
in interface Cache<K,V>
public Stats getStats()
getStats
in interface AdvancedCache<K,V>
public XAResource getXAResource()
AdvancedCache
getXAResource
in interface AdvancedCache<K,V>
public final V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
Map.put(Object, Object)
, which takes in lifespan parameters.
put
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
ConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.
putIfAbsent
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
Map.putAll(Map)
, which takes in lifespan parameters. Note that the lifespan is applied
to all mappings in the map passed in.
putAll
in interface Cache<K,V>
map
- map containing mappings to enterlifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle timepublic final V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
ConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.
replace
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
ConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.
replace
in interface Cache<K,V>
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final NotifyingFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
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.
putAsync
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredmaxIdleUnit
- time unit for max idle time
public final NotifyingFuture<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
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.
putAllAsync
in interface Cache<K,V>
data
- to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredmaxIdleUnit
- time unit for max idle time
public final NotifyingFuture<Void> clearAsync()
Cache
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.
clearAsync
in interface Cache<K,V>
public final NotifyingFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
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.
putIfAbsentAsync
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredmaxIdleUnit
- time unit for max idle time
public final NotifyingFuture<V> removeAsync(Object key)
Cache
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.
removeAsync
in interface Cache<K,V>
key
- key to remove
public final NotifyingFuture<Boolean> removeAsync(Object key, Object value)
Cache
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.
removeAsync
in interface Cache<K,V>
key
- key to removevalue
- value to match on
public final NotifyingFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
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.
replaceAsync
in interface Cache<K,V>
key
- key to removevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredmaxIdleUnit
- time unit for max idle time
public final NotifyingFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
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.
replaceAsync
in interface Cache<K,V>
key
- key to removeoldValue
- value to overwritenewValue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredmaxIdleUnit
- time unit for max idle time
public NotifyingFuture<V> getAsync(K key)
Cache
Map.get(Object)
that allows user code to
retrieve the value associated with a key at a later stage, hence allowing
multiple parallel get requests to be sent. Normally, when this method
detects that the value is likely to be retrieved from from a remote
entity, it will span a different thread in order to allow the
asynchronous get call to return immediately. If the call will definitely
resolve locally, for example when the cache is configured with LOCAL mode
and no cache loaders are configured, the get asynchronous call will act
sequentially and will have no different to Map.get(Object)
.
getAsync
in interface Cache<K,V>
key
- key to retrieve
Map.get(Object)
public AdvancedCache<K,V> getAdvancedCache()
getAdvancedCache
in interface Cache<K,V>
public void compact()
Cache
compact
in interface Cache<K,V>
public RpcManager getRpcManager()
getRpcManager
in interface AdvancedCache<K,V>
public AdvancedCache<K,V> withFlags(Flag... flags)
AdvancedCache
cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);will invoke a cache.get() with a write lock forced.
withFlags
in interface AdvancedCache<K,V>
flags
- a set of flags to apply. See the Flag
documentation.
public ClassLoader getClassLoader()
getClassLoader
in interface AdvancedCache<K,V>
public AdvancedCache<K,V> with(ClassLoader classLoader)
with
in interface AdvancedCache<K,V>
protected void set(K key, V value)
CacheSupport
set
in class CacheSupport<K,V>
|
--> | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |