com.ibm.websphere.cache
Class ChangeEvent
- java.lang.Object
java.util.EventObject
com.ibm.websphere.cache.ChangeEvent
All implemented interfaces:
java.io.Serializable
- public class ChangeEvent
- extends java.util.EventObject
- 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 Summary
Modifier and Type | Field and Description |
---|---|
|
EXISTING_VALUE_CHANGED
Defines the cause of change for type EXISTING_VALUE_CHANGED
|
|
EXPIRATION_TIMES_CHANGED
Defines the cause of change for type EXPIRATION_TIMES_CHANGED.
|
|
LOCAL
Define source of change for LOCAL (cache in memory or disk)
|
|
m_cacheName
|
|
NEW_ENTRY_ADDED
Defines the cause of change for type NEW_ENTRY_ADDED
|
|
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 |
---|---|
|
getCacheName()
Gets the name of the cache
|
|
getCauseOfChange()
Gets the cause of change when this event was generated.
|
|
getId()
Gets the cache id that was changed.
|
|
getSourceOfChange()
Gets the source of change when this event was generated.
|
|
getTimeStamp()
Gets the timestamp of when this event was generated.
|
|
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
- public static final int EXISTING_VALUE_CHANGED
Defines the cause of change for type EXISTING_VALUE_CHANGED
See Also:
NEW_ENTRY_ADDED
- public static final int NEW_ENTRY_ADDED
Defines the cause of change for type NEW_ENTRY_ADDED
See Also:
EXPIRATION_TIMES_CHANGED
- 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
- public static final int LOCAL
Define source of change for LOCAL (cache in memory or disk)
See Also:
REMOTE
- public static final int REMOTE
Defines the source of change for type REMOTE
See Also:
m_cacheName
- public java.lang.String m_cacheName
Constructor Detail
ChangeEvent
- public 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 Detail
getId
- public java.lang.Object getId()
Gets the cache id that was changed.
Returns:
the cache id that was changed.
getValue
- 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
- 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
- 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
- public java.lang.String getCacheName( )
Gets the name of the cache
Returns:
the name of cache
getTimeStamp
- public long getTimeStamp()
Gets the timestamp of when this event was generated.
Returns:
the timestamp