com.ibm.websphere.cache

Class ChangeEvent

  1. java.lang.Object
  2. extended byjava.util.EventObject
  3. extended bycom.ibm.websphere.cache.ChangeEvent
All implemented interfaces:
java.io.Serializable

  1. public class ChangeEvent
  2. extends java.util.EventObject
An event object that provides information about the source of cache-related events. ChangeEvent objects are generated when cache entries are changed in the cache. The ChangeEvent object contains six pieces of information:
See Also:
Serialized Form

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
EXISTING_VALUE_CHANGED
Defines the cause of change for type EXISTING_VALUE_CHANGED
  1. static
  2. int
EXPIRATION_TIMES_CHANGED
Defines the cause of change for type EXPIRATION_TIMES_CHANGED.
  1. static
  2. int
LOCAL
Define source of change for LOCAL (cache in memory or disk)
  1. java.lang.String
m_cacheName
  1. static
  2. int
NEW_ENTRY_ADDED
Defines the cause of change for type NEW_ENTRY_ADDED
  1. static
  2. int
REMOTE
Defines the source of change for type REMOTE
Fields inherited from class java.util.EventObject
source

Constructor Summary

Constructor and Description
ChangeEvent(java.lang.Object id,java.lang.Object value,int causeOfChange,int sourceOfChange,java.lang.String cacheName)
Create a new ChangeEvent from id, value, cause of change, source of change and cache name

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
getCacheName()
Gets the name of the cache
  1. int
getCauseOfChange()
Gets the cause of change when this event was generated.
  1. java.lang.Object
getId()
Gets the cache id that was changed.
  1. int
getSourceOfChange()
Gets the source of change when this event was generated.
  1. long
getTimeStamp()
Gets the timestamp of when this event was generated.
  1. java.lang.Object
getValue()
Gets new value.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

EXISTING_VALUE_CHANGED

  1. public static final int EXISTING_VALUE_CHANGED
Defines the cause of change for type EXISTING_VALUE_CHANGED
See Also:

NEW_ENTRY_ADDED

  1. public static final int NEW_ENTRY_ADDED
Defines the cause of change for type NEW_ENTRY_ADDED
See Also:

EXPIRATION_TIMES_CHANGED

  1. public static final int EXPIRATION_TIMES_CHANGED
Defines the cause of change for type EXPIRATION_TIMES_CHANGED. This constant is used by Validation Based Cache feature.
See Also:

LOCAL

  1. public static final int LOCAL
Define source of change for LOCAL (cache in memory or disk)
See Also:

REMOTE

  1. public static final int REMOTE
Defines the source of change for type REMOTE
See Also:

m_cacheName

  1. public java.lang.String m_cacheName

Constructor Detail

ChangeEvent

  1. public ChangeEvent(java.lang.Object id,
  2. java.lang.Object value,
  3. int causeOfChange,
  4. int sourceOfChange,
  5. java.lang.String cacheName)
Create a new ChangeEvent from id, value, cause of change, source of change and cache name

Method Detail

getId

  1. public java.lang.Object getId()
Gets the cache id that was changed.
Returns:
the cache id that was changed.

getValue

  1. public java.lang.Object getValue( )
Gets new value. The value might be serialized in a byte array format. In this case, you must deserialize the returned value.
Returns:
the new value.

getCauseOfChange

  1. public int getCauseOfChange()
Gets the cause of change when this event was generated. Use defined constants: EXISTING_VALUE_CHANGED or NEW_ENTRY_ADDED
Returns:
the cause of change

getSourceOfChange

  1. public int getSourceOfChange()
Gets the source of change when this event was generated. Use defined constants: LOCAL and REMOTE
Returns:
the cause of change

getCacheName

  1. public java.lang.String getCacheName( )
Gets the name of the cache
Returns:
the name of cache

getTimeStamp

  1. public long getTimeStamp()
Gets the timestamp of when this event was generated.
Returns:
the timestamp