Package com.ibm.websphere.cache
Class ChangeEvent
java.lang.Object
java.util.EventObject
com.ibm.websphere.cache.ChangeEvent
- All Implemented Interfaces:
- Serializable
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:
 
- id - the id that was changed
- value - the new value
- causeOfChange - the cause of change that generated this event (defined as EXISTING_VALUE_CHANGED or NEW_ENTRY_ADDED)
- sourceOfChange - the source of change that generated this event (defined as LOCAL or REMOTE)
- cacheName - the name of the cache
- timestamp - the timestamp of when this event was generated
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefines the cause of change for type EXISTING_VALUE_CHANGEDstatic final intDefines the cause of change for type EXPIRATION_TIMES_CHANGED.static final intDefine source of change for LOCAL (cache in memory or disk)static final intDefines the cause of change for type NEW_ENTRY_ADDEDstatic final intDefines the source of change for type REMOTE
- 
Constructor SummaryConstructorsConstructorDescriptionChangeEvent(Object id, Object value, int causeOfChange, int sourceOfChange, String cacheName) Create a new ChangeEvent from id, value, cause of change, source of change and cache name
- 
Method SummaryModifier and TypeMethodDescriptionGets the name of the cacheintGets the cause of change when this event was generated.getId()Gets the cache id that was changed.intGets the source of change when this event was generated.longGets the timestamp of when this event was generated.getValue()Gets new value.Methods inherited from class java.util.EventObjectgetSource, toString
- 
Field Details- 
EXISTING_VALUE_CHANGEDpublic static final int EXISTING_VALUE_CHANGEDDefines the cause of change for type EXISTING_VALUE_CHANGED- See Also:
 
- 
NEW_ENTRY_ADDEDpublic static final int NEW_ENTRY_ADDEDDefines the cause of change for type NEW_ENTRY_ADDED- See Also:
 
- 
EXPIRATION_TIMES_CHANGEDpublic static final int EXPIRATION_TIMES_CHANGEDDefines the cause of change for type EXPIRATION_TIMES_CHANGED. This constant is used by Validation Based Cache feature.- See Also:
 
- 
LOCALpublic static final int LOCALDefine source of change for LOCAL (cache in memory or disk)- See Also:
 
- 
REMOTEpublic static final int REMOTEDefines the source of change for type REMOTE- See Also:
 
- 
m_cacheName
 
- 
- 
Constructor Details
- 
Method Details- 
getIdGets the cache id that was changed.- Returns:
- the cache id that was changed.
 
- 
getValueGets 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.
 
- 
getCauseOfChangepublic 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
 
- 
getSourceOfChangepublic int getSourceOfChange()Gets the source of change when this event was generated. Use defined constants: LOCAL and REMOTE- Returns:
- the cause of change
 
- 
getCacheNameGets the name of the cache- Returns:
- the name of cache
 
- 
getTimeStamppublic long getTimeStamp()Gets the timestamp of when this event was generated.- Returns:
- the timestamp
 
 
-