Allows execution of code which may mutate a cache entry with exclusive
access (including reads) to that entry.
Any mutations will not take effect till after the processor has completed; if an exception
thown inside the processor, no changes will be made to the cache.
This enables a way to perform compound operations without transactions
involving a cache entry atomically. Such operations may include mutations.
The mutations can be potentially done in place avoiding expensive network transfers.
An example is a value which is a list and you simply want to append a new element to it.
An entry processor cannot invoke any cache operations, including processor operations.
If executed in a JVM remote from the one invoke was called in, an EntryProcessor equal
to the local one will execute the invocation. For remote to execution to succeed, the
EntryProcessor implementation class must be in the excecuting class loader as must K and
V if
Cache.Entry.getKey()
or
Cache.Entry.getValue()
is invoked.