public class RemoteCacheWithSyncListeners<K,V> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected RemoteCache<K,V> |
delegate |
| Constructor and Description |
|---|
RemoteCacheWithSyncListeners(RemoteCache<K,V> delegate,
AbstractJCacheNotifier<K,V> notifier,
javax.cache.Cache<K,V> cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClientListener(Object listener)
Add a client listener to receive events that happen in the remote cache.
|
void |
addClientListener(Object listener,
Object[] filterFactoryParams,
Object[] converterFactoryParams)
Add a client listener to receive events that happen in the remote cache.
|
void |
clear() |
NotifyingFuture |
clearAsync()
Asynchronous version of
#clear(). |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
Map<K,V> |
getAll(Set<? extends K> keys)
Retrieves all of the entries for the provided keys.
|
NotifyingFuture<V> |
getAsync(K key)
Asynchronous version of
#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. |
Map<K,V> |
getBulk()
Bulk get operations, returns all the entries within the remote cache.
|
Map<K,V> |
getBulk(int size)
Same as
RemoteCache.getBulk(), but limits the returned set of values to the specified size. |
Set |
getListeners()
Returns a set with all the listeners registered by this client for the
given cache.
|
String |
getName()
Retrieves the name of the cache
|
String |
getProtocolVersion()
Returns the HotRod protocol version supported by this RemoteCache implementation
|
RemoteCacheManager |
getRemoteCacheManager()
Returns the
RemoteCacheManager that created this cache. |
String |
getVersion()
Retrieves the version of Infinispan
|
VersionedValue<V> |
getVersioned(K key)
Returns the
VersionedValue associated to the supplied key param, or null if it doesn't exist. |
MetadataValue<V> |
getWithMetadata(K key)
Returns the
MetadataValue associated to the supplied key param, or null if it doesn't exist. |
boolean |
isEmpty() |
Set<K> |
keySet()
Returns all keys in the remote server.
|
V |
put(K key,
V value)
If the return value of this operation will be ignored by the application,
the user is strongly encouraged to use the
Flag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently
as possible (i.e. |
V |
put(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
BasicCache.put(Object, Object), which takes in lifespan parameters. |
V |
put(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of
BasicCache.put(Object, Object), which takes in lifespan parameters. |
void |
putAll(Map<? extends K,? extends V> m)
Synthetic operation.
|
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit unit)
Synthetic operation.
|
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
Synthetic operation.
|
NotifyingFuture |
putAllAsync(Map<? extends K,? extends V> data)
Synthetic operation.
|
NotifyingFuture |
putAllAsync(Map<? extends K,? extends V> data,
long lifespan,
TimeUnit unit)
Synthetic operation.
|
NotifyingFuture |
putAllAsync(Map<? extends K,? extends V> data,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Synthetic operation.
|
NotifyingFuture<V> |
putAsync(K key,
V value)
Asynchronous version of
#put(Object, Object). |
NotifyingFuture<V> |
putAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
#put(Object, Object, long, TimeUnit) . |
NotifyingFuture<V> |
putAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of
#put(Object, Object, long, TimeUnit, long, TimeUnit). |
V |
putIfAbsent(K key,
V value) |
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
ConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters. |
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of
ConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters. |
NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value)
Asynchronous version of
#putIfAbsent(Object, Object). |
NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
#putIfAbsent(Object, Object, long, TimeUnit) . |
NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of
#putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit). |
V |
remove(Object key)
If the return value of this operation will be ignored by the application,
the user is strongly encouraged to use the
Flag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently
as possible (i.e. |
boolean |
remove(Object key,
Object oldValue) |
NotifyingFuture<V> |
removeAsync(Object key)
Asynchronous version of
#remove(Object). |
NotifyingFuture |
removeAsync(Object key,
Object value)
Asynchronous version of
#remove(Object, Object). |
void |
removeClientListener(Object listener)
Remove a previously added client listener.
|
boolean |
removeWithVersion(K key,
long version)
Removes the given entry only if its version matches the supplied version.
|
NotifyingFuture |
removeWithVersionAsync(K key,
long version) |
V |
replace(K key,
V value) |
V |
replace(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
ConcurrentMap.replace(Object, Object), which takes in lifespan parameters. |
V |
replace(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of
ConcurrentMap.replace(Object, Object), which takes in lifespan parameters. |
boolean |
replace(K key,
V oldValue,
V newValue) |
boolean |
replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
ConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters. |
boolean |
replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of
ConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters. |
NotifyingFuture<V> |
replaceAsync(K key,
V value)
Asynchronous version of
#replace(Object, Object). |
NotifyingFuture<V> |
replaceAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
#replace(Object, Object, long, TimeUnit). |
NotifyingFuture<V> |
replaceAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of
#replace(Object, Object, long, TimeUnit, long, TimeUnit). |
NotifyingFuture |
replaceAsync(K key,
V oldValue,
V newValue)
Asynchronous version of
#replace(Object, Object, Object). |
NotifyingFuture |
replaceAsync(K key,
V oldValue,
V newValue,
long lifespan,
TimeUnit unit)
Asynchronous version of
#replace(Object, Object, Object, long, TimeUnit). |
NotifyingFuture |
replaceAsync(K key,
V oldValue,
V newValue,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of
#replace(Object, Object, Object, long, TimeUnit, long, TimeUnit). |
boolean |
replaceWithVersion(K key,
V newValue,
long version)
Replaces the given value only if its version matches the supplied version.
|
boolean |
replaceWithVersion(K key,
V newValue,
long version,
int lifespanSeconds)
A overloaded form of
RemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan parameters. |
boolean |
replaceWithVersion(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleTimeSeconds)
A overloaded form of
RemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters. |
boolean |
replaceWithVersion(K key,
V newValue,
long version,
long lifespan,
TimeUnit lifespanTimeUnit,
long maxIdle,
TimeUnit maxIdleTimeUnit)
A overloaded form of
RemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters. |
NotifyingFuture |
replaceWithVersionAsync(K key,
V newValue,
long version) |
NotifyingFuture |
replaceWithVersionAsync(K key,
V newValue,
long version,
int lifespanSeconds) |
NotifyingFuture |
replaceWithVersionAsync(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleSeconds) |
int |
size() |
void |
start() |
ServerStatistics |
stats() |
void |
stop() |
Collection<V> |
values() |
RemoteCache<K,V> |
withFlags(Flag... flags)
Applies one or more
Flags to the scope of a single invocation. |
protected final RemoteCache<K,V> delegate
public RemoteCacheWithSyncListeners(RemoteCache<K,V> delegate, AbstractJCacheNotifier<K,V> notifier, javax.cache.Cache<K,V> cache)
public V put(K key, V value)
BasicCacheFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently
as possible (i.e. avoiding needless remote or network calls).put in interface BasicCache<K,V>public V remove(Object key)
BasicCacheFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently
as possible (i.e. avoiding needless remote or network calls).remove in interface BasicCache<K,V>public boolean replaceWithVersion(K key, V newValue, long version)
RemoteCacheRemoteCache.removeWithVersion(Object, long) for a sample usage of the
version-based methods.replaceWithVersion in interface RemoteCache<K,V>version - numeric version that should match the one in the server
for the operation to succeedRemoteCache.getVersioned(Object),
VersionedValuepublic void addClientListener(Object listener)
RemoteCacheaddClientListener in interface RemoteCache<K,V>public void addClientListener(Object listener, Object[] filterFactoryParams, Object[] converterFactoryParams)
RemoteCacheaddClientListener in interface RemoteCache<K,V>public void clear()
public NotifyingFuture clearAsync()
AsyncCache#clear(). This method does not block on remote calls, even if your cache mode is
synchronous. Has no benefit over #clear() if used in LOCAL mode.clearAsync in interface AsyncCache<K,V>public boolean containsKey(Object key)
public boolean containsValue(Object value)
containsValue in interface RemoteCache<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface RemoteCache<K,V>public V get(Object key)
public Map<K,V> getAll(Set<? extends K> keys)
RemoteCachegetAll in interface RemoteCache<K,V>keys - The keys to find values forpublic NotifyingFuture<V> getAsync(K key)
AsyncCache#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 stores are configured, the get asynchronous call will act
sequentially and will have no different to #get(Object).getAsync in interface AsyncCache<K,V>key - key to retrieve#get(Object)public Map<K,V> getBulk()
RemoteCachegetBulk in interface RemoteCache<K,V>public Map<K,V> getBulk(int size)
RemoteCacheRemoteCache.getBulk(), but limits the returned set of values to the specified size. No ordering is guaranteed, and there is no
guarantee that "size" elements are returned( e.g. if the number of elements in the back-end server is smaller that "size")getBulk in interface RemoteCache<K,V>public Set getListeners()
RemoteCachegetListeners in interface RemoteCache<K,V>public String getName()
BasicCachegetName in interface BasicCache<K,V>public String getProtocolVersion()
RemoteCachegetProtocolVersion in interface RemoteCache<K,V>public RemoteCacheManager getRemoteCacheManager()
RemoteCacheRemoteCacheManager that created this cache.getRemoteCacheManager in interface RemoteCache<K,V>public String getVersion()
BasicCachegetVersion in interface BasicCache<K,V>public VersionedValue<V> getVersioned(K key)
RemoteCacheVersionedValue associated to the supplied key param, or null if it doesn't exist.getVersioned in interface RemoteCache<K,V>public MetadataValue<V> getWithMetadata(K key)
RemoteCacheMetadataValue associated to the supplied key param, or null if it doesn't exist.getWithMetadata in interface RemoteCache<K,V>public boolean isEmpty()
isEmpty in interface RemoteCache<K,V>public Set<K> keySet()
RemoteCachekeySet in interface RemoteCache<K,V>public V put(K key,
V value,
long lifespan,
TimeUnit unit)
BasicCacheBasicCache.put(Object, Object), which takes in lifespan parameters.put in interface BasicCache<K,V>key - key to usevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic V put(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
BasicCacheBasicCache.put(Object, Object), which takes in lifespan parameters.put in interface BasicCache<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
expiredmaxIdleTimeUnit - time unit for max idle timepublic void putAll(Map<? extends K,? extends V> m)
RemoteCacheputAll in interface RemoteCache<K,V>RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit unit)
RemoteCacheputAll in interface RemoteCache<K,V>putAll in interface BasicCache<K,V>map - map containing mappings to enterlifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
RemoteCacheputAll in interface RemoteCache<K,V>putAll in interface BasicCache<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
expiredmaxIdleTimeUnit - time unit for max idle timeRemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)public NotifyingFuture putAllAsync(Map<? extends K,? extends V> data)
RemoteCacheputAllAsync in interface RemoteCache<K,V>putAllAsync in interface AsyncCache<K,V>data - to storeRemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)public NotifyingFuture putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit unit)
RemoteCacheputAllAsync in interface RemoteCache<K,V>putAllAsync in interface AsyncCache<K,V>data - to storelifespan - lifespan of entryunit - time unit for lifespanRemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)public NotifyingFuture putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
RemoteCacheputAllAsync in interface RemoteCache<K,V>putAllAsync in interface AsyncCache<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 timeRemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)public NotifyingFuture<V> putAsync(K key, V value)
AsyncCache#put(Object, Object). This method does not block on remote calls, even if your
cache mode is synchronous. Has no benefit over #put(Object, Object) if used in LOCAL mode.
putAsync in interface AsyncCache<K,V>key - key to usevalue - value to storepublic NotifyingFuture<V> putAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCache#put(Object, Object, long, TimeUnit) . This method does not block on remote
calls, even if your cache mode is synchronous. Has no benefit over #put(Object, Object, long, TimeUnit)
if used in LOCAL mode.putAsync in interface AsyncCache<K,V>key - key to usevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic NotifyingFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
AsyncCache#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 #put(Object, Object, long,
TimeUnit, long, TimeUnit) if used in LOCAL mode.putAsync in interface AsyncCache<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 timepublic V putIfAbsent(K key,
V value,
long lifespan,
TimeUnit unit)
BasicCacheConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters.putIfAbsent in interface BasicCache<K,V>key - key to usevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic V putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
BasicCacheConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters.putIfAbsent in interface BasicCache<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
expiredmaxIdleTimeUnit - time unit for max idle timepublic NotifyingFuture<V> putIfAbsentAsync(K key, V value)
AsyncCache#putIfAbsent(Object, Object). This method does not block on remote calls, even if
your cache mode is synchronous. Has no benefit over #putIfAbsent(Object, Object) if used in LOCAL mode.
putIfAbsentAsync in interface AsyncCache<K,V>key - key to usevalue - value to storepublic NotifyingFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCache#putIfAbsent(Object, Object, long, TimeUnit) . This method does not block on
remote calls, even if your cache mode is synchronous. Has no benefit over #putIfAbsent(Object, Object,
long, TimeUnit) if used in LOCAL mode.putIfAbsentAsync in interface AsyncCache<K,V>key - key to usevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic NotifyingFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
AsyncCache#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 #putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.putIfAbsentAsync in interface AsyncCache<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 timepublic NotifyingFuture<V> removeAsync(Object key)
AsyncCache#remove(Object). This method does not block on remote calls, even if your cache
mode is synchronous. Has no benefit over #remove(Object) if used in LOCAL mode.removeAsync in interface AsyncCache<K,V>key - key to removepublic NotifyingFuture removeAsync(Object key, Object value)
AsyncCache#remove(Object, Object). This method does not block on remote calls, even if your
cache mode is synchronous. Has no benefit over #remove(Object, Object) if used in LOCAL mode.removeAsync in interface AsyncCache<K,V>key - key to removevalue - value to match onpublic void removeClientListener(Object listener)
RemoteCacheremoveClientListener in interface RemoteCache<K,V>public boolean removeWithVersion(K key,
long version)
RemoteCacheVersionedEntry ve = remoteCache.getVersioned(key); //some processing remoteCache.removeWithVersion(key, ve.getVersion();Lat call (removeWithVersion) will make sure that the entry will only be removed if it hasn't been changed in between.
removeWithVersion in interface RemoteCache<K,V>VersionedValue,
RemoteCache.getVersioned(Object)public NotifyingFuture removeWithVersionAsync(K key, long version)
removeWithVersionAsync in interface RemoteCache<K,V>ConcurrentMap.remove(Object, Object)public V replace(K key,
V value,
long lifespan,
TimeUnit unit)
BasicCacheConcurrentMap.replace(Object, Object), which takes in lifespan parameters.replace in interface BasicCache<K,V>key - key to usevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic V replace(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
BasicCacheConcurrentMap.replace(Object, Object), which takes in lifespan parameters.replace in interface BasicCache<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
expiredmaxIdleTimeUnit - time unit for max idle timepublic boolean replace(K key,
V oldValue,
V newValue)
public boolean replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit unit)
BasicCacheConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters.replace in interface BasicCache<K,V>key - key to useoldValue - value to replacevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic boolean replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
BasicCacheConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters.replace in interface BasicCache<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
expiredmaxIdleTimeUnit - time unit for max idle timepublic NotifyingFuture<V> replaceAsync(K key, V value)
AsyncCache#replace(Object, Object). This method does not block on remote calls, even if
your cache mode is synchronous. Has no benefit over #replace(Object, Object) if used in LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removevalue - value to storepublic NotifyingFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCache#replace(Object, Object, long, TimeUnit). This method does not block on remote
calls, even if your cache mode is synchronous. Has no benefit over #replace(Object, Object, long,
TimeUnit) if used in LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic NotifyingFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
AsyncCache#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 #replace(Object,
Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.replaceAsync in interface AsyncCache<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 timepublic NotifyingFuture replaceAsync(K key, V oldValue, V newValue)
AsyncCache#replace(Object, Object, Object). This method does not block on remote calls,
even if your cache mode is synchronous. Has no benefit over #replace(Object, Object, Object) if used in
LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removeoldValue - value to overwritenewValue - value to storepublic NotifyingFuture replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit unit)
AsyncCache#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 #replace(Object, Object, Object,
long, TimeUnit) if used in LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removeoldValue - value to overwritenewValue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic NotifyingFuture replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
AsyncCache#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 #replace(Object, Object, Object, long, TimeUnit, long, TimeUnit) if used in LOCAL mode.replaceAsync in interface AsyncCache<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 timepublic boolean replaceWithVersion(K key,
V newValue,
long version,
int lifespanSeconds)
RemoteCacheRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan parameters.replaceWithVersion in interface RemoteCache<K,V>key - key to usenewValue - new value to be associated with the keyversion - numeric version that should match the one in the server
for the operation to succeedlifespanSeconds - lifespan of the entrypublic boolean replaceWithVersion(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleTimeSeconds)
RemoteCacheRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.replaceWithVersion in interface RemoteCache<K,V>key - key to usenewValue - new value to be associated with the keyversion - numeric version that should match the one in the server
for the operation to succeedlifespanSeconds - lifespan of the entrymaxIdleTimeSeconds - the maximum amount of time this key is allowed
to be idle for before it is considered as expiredpublic boolean replaceWithVersion(K key,
V newValue,
long version,
long lifespan,
TimeUnit lifespanTimeUnit,
long maxIdle,
TimeUnit maxIdleTimeUnit)
RemoteCacheRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.replaceWithVersion in interface RemoteCache<K,V>key - key to usenewValue - new value to be associated with the keyversion - numeric version that should match the one in the server
for the operation to succeedlifespan - lifespan of the entrylifespanTimeUnit - TimeUnit for lifespanmaxIdle - the maximum amount of time this key is allowed
to be idle for before it is considered as expiredmaxIdleTimeUnit - TimeUnit for maxIdlepublic NotifyingFuture replaceWithVersionAsync(K key, V newValue, long version)
replaceWithVersionAsync in interface RemoteCache<K,V>RemoteCache.replaceWithVersion(Object, Object, long)public NotifyingFuture replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds)
replaceWithVersionAsync in interface RemoteCache<K,V>RemoteCache.replaceWithVersion(Object, Object, long)public NotifyingFuture replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds, int maxIdleSeconds)
replaceWithVersionAsync in interface RemoteCache<K,V>RemoteCache.replaceWithVersion(Object, Object, long)public int size()
size in interface RemoteCache<K,V>public ServerStatistics stats()
stats in interface RemoteCache<K,V>public Collection<V> values()
values in interface RemoteCache<K,V>public RemoteCache<K,V> withFlags(Flag... flags)
RemoteCacheFlags to the scope of a single invocation. See the Flag enumeration to for
information on available flags.
Sample usage:
remoteCache.withFlags(Flag.FORCE_RETURN_VALUE).put("hello", "world");
withFlags in interface RemoteCache<K,V>Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.