K
- the type of keys maintained by this cacheV
- the type of cached valuespublic static interface Cache.EntryProcessor<K,V,T>
Cache.Entry
atomically, according the the defined
consistency of a Cache
.
Any Cache.Entry
mutations will not take effect until after the
process(javax.cache.Cache.MutableEntry, Object...)
method has completed execution.
If an exception is thrown by an Cache.EntryProcessor
, the exception will
be returned wrapped in an CacheException
. No changes will be made
to the Cache.Entry
.
Implementations may execute Cache.EntryProcessor
s in situ, thus avoiding
locking, round-trips and expensive network transfers.
Cache.Entry
access, via a call to
Cache.Entry.getValue()
, will behave as if
Cache.get(Object)
was called for the key. This includes updating
necessary statistics, consulting the configured
ExpiryPolicy
and loading from a configured
CacheLoader
.
Cache.Entry
mutation, via a call to
Cache.MutableEntry.setValue(Object)
, will behave
as if Cache.put(Object, Object)
was called for the key. This
includes updating necessary statistics, consulting the configured
ExpiryPolicy
, notifying
CacheEntryListener
s and a writing to a configured
CacheWriter
.
Cache.Entry
removal, via a call to
Cache.MutableEntry.remove()
, will behave
as if Cache.remove(Object)
was called for the key. This
includes updating necessary statistics, notifying
CacheEntryListener
s and causing a delete on a
configured CacheWriter
.
As implementations may choose to execute Cache.EntryProcessor
s remotely,
Cache.EntryProcessor
s, together with specified parameters and return
values, may be required to implement Serializable
.T process(Cache.MutableEntry<K,V> entry, Object... arguments)
entry
- the entryarguments
- a number of arguments to the process.Copyright © 2013. All Rights Reserved.