K
- V
- public class InvalidatedNearRemoteCache<K,V> extends RemoteCacheImpl<K,V>
RemoteCache
implementation
enablingoperationsFactory
defaultLifespan, defaultMaxIdleTime
Constructor and Description |
---|
InvalidatedNearRemoteCache(RemoteCacheManager rcm,
String name,
NearCacheService<K,V> nearcache) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
V |
get(Object key) |
VersionedValue<V> |
getVersioned(K key)
Returns the
VersionedValue associated to the supplied key param, or null if it doesn't exist. |
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> map,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
Synthetic operation.
|
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 |
removeWithVersion(K key,
long version)
Removes the given entry only if its version matches the supplied version.
|
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 |
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. |
void |
start()
Invoked on component start
|
void |
stop()
Invoked on component stop
|
addClientListener, addClientListener, clearAsync, containsKey, execute, getAll, getAsync, getBulk, getBulk, getCacheTopologyInfo, getListeners, getName, getOperationsFactory, getProtocolVersion, getRemoteCacheManager, getVersion, getWithMetadata, init, isEmpty, keySet, ping, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, removeAsync, removeClientListener, removeWithVersionAsync, replaceAsync, replaceWithVersion, replaceWithVersionAsync, resolveCompatibility, retrieveEntries, retrieveEntries, retrieveEntries, retrieveEntriesByQuery, retrieveEntriesWithMetadata, set, size, stats, withFlags
containsValue, entrySet, put, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, remove, removeAsync, replace, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
public InvalidatedNearRemoteCache(RemoteCacheManager rcm, String name, NearCacheService<K,V> nearcache)
public VersionedValue<V> getVersioned(K key)
RemoteCache
VersionedValue
associated to the supplied key param, or null if it doesn't exist.getVersioned
in interface RemoteCache<K,V>
getVersioned
in class RemoteCacheImpl<K,V>
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
BasicCache
BasicCache.put(Object, Object)
, which takes in lifespan parameters.put
in interface BasicCache<K,V>
put
in class RemoteCacheImpl<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> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
RemoteCache
putAll
in interface RemoteCache<K,V>
putAll
in interface BasicCache<K,V>
putAll
in class RemoteCacheImpl<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 V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
BasicCache
ConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.replace
in interface BasicCache<K,V>
replace
in class RemoteCacheImpl<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 replaceWithVersion(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
RemoteCache
RemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.replaceWithVersion
in interface RemoteCache<K,V>
replaceWithVersion
in class RemoteCacheImpl<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 V remove(Object key)
BasicCache
Flag.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).public boolean removeWithVersion(K key, long version)
RemoteCache
VersionedEntry 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>
removeWithVersion
in class RemoteCacheImpl<K,V>
VersionedValue
,
RemoteCache.getVersioned(Object)
public void clear()
public void start()
Lifecycle
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.