public interface EntryEvent<K,V> extends CacheEvent<K,V>
CacheListener
,
CapacityController
, and CacheWriter
.
If this event originated from a region stored off heap then this event can only be used as long
as the notification method that obtained it has not returned. For example in your implementation
of CacheListener.afterUpdate(EntryEvent)
the event parameter is only valid until your
afterUpdate method returns. It is not safe to store instances of this class and use them later
when using off heap storage. Attempts to access off-heap data from this event after it has
expired will result in an IllegalStateException.
CacheListener
,
CacheWriter
,
RegionEvent
Modifier and Type | Method and Description |
---|---|
K |
getKey()
Returns the key.
|
V |
getNewValue()
Returns the value in the cache after this event.
|
V |
getOldValue()
Returns the value in the cache prior to this event.
|
SerializedCacheValue<V> |
getSerializedNewValue()
Returns the serialized form of the value in the cache after this event.
|
SerializedCacheValue<V> |
getSerializedOldValue()
Returns the serialized form of the value in the cache before this event.
|
TransactionId |
getTransactionId()
Gets the TransactionId for this EntryEvent.
|
boolean |
hasClientOrigin()
Returns true if this event originated on a client.
|
boolean |
isOldValueAvailable()
Returns
true if the old value is "available". |
getCallbackArgument, getDistributedMember, getOperation, getRegion, isCallbackArgumentAvailable, isOriginRemote
K getKey()
V getOldValue()
null
is returned. This can happen
for disk regions when the old value is on disk only.IllegalStateException
- if off-heap and called after the method that was passed this
EntryEvent returns.SerializedCacheValue<V> getSerializedOldValue()
IllegalStateException
- if off-heap and called after the method that was passed this
EntryEvent returns.V getNewValue()
IllegalStateException
- if off-heap and called after the method that was passed this
EntryEvent returns.SerializedCacheValue<V> getSerializedNewValue()
IllegalStateException
- if off-heap and called after the method that was passed this
EntryEvent returns.TransactionId getTransactionId()
boolean hasClientOrigin()
boolean isOldValueAvailable()
true
if the old value is "available". Not available means that an old
value existed but it could not be obtained or it was deemed too expensive to obtain. Note that
getOldValue()
will return null
when this method returns false
.