K
- the type of keyV
- the type of valueSerializable
, Cache.Entry<K,V>
public abstract class CacheEntryEvent<K,V> extends EventObject implements Cache.Entry<K,V>
source
Constructor | Description |
---|---|
CacheEntryEvent(Cache source,
EventType eventType) |
Constructs a cache entry event from a given cache as source
|
Modifier and Type | Method | Description |
---|---|---|
EventType |
getEventType() |
Gets the event type of this event
|
abstract V |
getOldValue() |
Returns the previous value that existed for entry in the cache before
modification or removal.
|
Cache |
getSource() |
|
abstract V |
getValue() |
Returns the value stored in the cache when this entry was created or updated.
|
abstract boolean |
isOldValueAvailable() |
Whether the old value is available.
|
getKey, unwrap
toString
public final Cache getSource()
getSource
in class EventObject
public abstract V getValue()
The value will be available
for CacheEntryCreatedListener
and CacheEntryUpdatedListener
.
Returns the same value as getOldValue()
for
CacheEntryExpiredListener
and CacheEntryRemovedListener
.
Cache clients that need to maintain compatibility with JSR107 version 1.0
cache implementations, need to use this method for retrieving the expired
or removed value. When using cache implementations compatible with JSR107
version 1.1, clients should prefer the method getOldValue()
.
getValue
in interface Cache.Entry<K,V>
getOldValue()
public abstract V getOldValue()
CacheEntryUpdatedListener
, CacheEntryExpiredListener
and CacheEntryRemovedListener
if CacheEntryListenerConfiguration.isOldValueRequired()
is true.
The old value may be available for CacheEntryUpdatedListener
,
CacheEntryExpiredListener
and CacheEntryRemovedListener
if CacheEntryListenerConfiguration.isOldValueRequired()
is false.null
if there was no previous
value or the previous value is not availablepublic abstract boolean isOldValueAvailable()
CacheEntryUpdatedListener
, CacheEntryExpiredListener
and CacheEntryRemovedListener
if CacheEntryListenerConfiguration.isOldValueRequired()
is true.
The old value may be available for CacheEntryUpdatedListener
,
CacheEntryExpiredListener
and CacheEntryRemovedListener
if CacheEntryListenerConfiguration.isOldValueRequired()
is false.public final EventType getEventType()
Copyright © 2017. All rights reserved.