javax.cache.event
Class CacheEntryEvent<K,V>

java.lang.Object
  extended by java.util.EventObject
      extended by javax.cache.event.CacheEntryEvent<K,V>
Type Parameters:
K - the type of keys maintained by this cache
V - the type of cached values
All Implemented Interfaces:
Serializable

public abstract class CacheEntryEvent<K,V>
extends EventObject

A Cache event base class

Since:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CacheEntryEvent(Cache source)
          Constructs a cache entry event from a given cache as source
 
Method Summary
abstract  K getKey()
          Returns the key of the cache entry with the event
abstract  V getOldValue()
          Returns the value of the cache entry with the event
 Cache getSource()
          
abstract  V getValue()
          Returns the value of the cache entry with the event
abstract  boolean isOldValueAvailable()
          Whether the old value is available
 
Methods inherited from class java.util.EventObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheEntryEvent

public CacheEntryEvent(Cache source)
Constructs a cache entry event from a given cache as source

Parameters:
source - the cache that originated the event
Method Detail

getSource

public final Cache getSource()

Overrides:
getSource in class EventObject

getKey

public abstract K getKey()
Returns the key of the cache entry with the event

Returns:
the key

getValue

public abstract V getValue()
Returns the value of the cache entry with the event

Returns:
the value

getOldValue

public abstract V getOldValue()
                       throws UnsupportedOperationException
Returns the value of the cache entry with the event

Returns:
the value
Throws:
UnsupportedOperationException - if the old value is not available

isOldValueAvailable

public abstract boolean isOldValueAvailable()
Whether the old value is available

Returns:
true if the old value is populated


Copyright © 2013. All Rights Reserved.