#include <coherence/net/cache/CacheEvent.hpp>
Inherits MapEvent.
Inherited by ConverterCollections::ConverterCacheEvent, and MapListenerSupport::FilterEvent.
Consider a client code calling a remove() method for a cache. Quite naturally it causes a corresponding entry_deleted event. However, the same event could be as well caused by the client code calling put() forcing an entry eviction. Alternatively, the put() method called by client code naturally causes either entry_inserted or entry_updated event. However, the same event could be as well caused by a client call to a get() method that in turn forces an entry insertion by a cache loader.
Public Types | |
enum | TransformationState { non_transformable, transformable, transformed } |
Transformation state constants. More... | |
typedef spec::Handle | Handle |
CacheEvent Handle definition. | |
typedef spec::View | View |
CacheEvent View definition. | |
typedef spec::Holder | Holder |
CacheEvent Holder definition. | |
Public Member Functions | |
virtual bool | isSynthetic () const |
Return true iff this event is caused by internal cache processing such as eviction or loading. | |
virtual TransformationState | getTransformState () const |
Return transformation state of this event. | |
virtual String::View | getDescription () const |
Return a human-readable description of the state of this class in the form of a delimited list of name-value pairs. The default implementation returns an empty string | |
Protected Member Functions | |
CacheEvent (ObservableMap::Handle hMap, int32_t nId, Object::View voKey, Object::View voValueOld, Object::View voValueNew, bool fSynthetic) | |
Create a new CacheEvent. | |
CacheEvent (ObservableMap::Handle hMap, int32_t nId, Object::View voKey, Object::View voValueOld, Object::View voValueNew, bool fSynthetic, TransformationState nTransformState) | |
Create a new CacheEvent. | |
Protected Attributes | |
bool | m_fSynthetic |
Event cause flag. | |
TransformationState | m_nTransformState |
The TransformationState for this event. |
enum TransformationState |
Transformation state constants.
TransformationState describes how a CacheEvent has been or should be transformed.
CacheEvent | ( | ObservableMap::Handle | hMap, | |
int32_t | nId, | |||
Object::View | voKey, | |||
Object::View | voValueOld, | |||
Object::View | voValueNew, | |||
bool | fSynthetic | |||
) | [protected] |
Create a new CacheEvent.
hMap | the map on which the Event initially | |
nId | occurred the events id (entry_inserted | entry_updated | entry_deleted) | |
voKey | the key into the map | |
voValueOld | the old value (for update and delete events) | |
voValueNew | the new value (for insert and update events) | |
fSynthetic | true iff the event is caused by internal cache processing such as eviction or loading |
CacheEvent | ( | ObservableMap::Handle | hMap, | |
int32_t | nId, | |||
Object::View | voKey, | |||
Object::View | voValueOld, | |||
Object::View | voValueNew, | |||
bool | fSynthetic, | |||
TransformationState | nTransformState | |||
) | [protected] |
Create a new CacheEvent.
hMap | the map on which the Event initially | |
nId | occurred the events id (entry_inserted | entry_updated | entry_deleted) | |
voKey | the key into the map | |
voValueOld | the old value (for update and delete events) | |
voValueNew | the new value (for insert and update events) | |
fSynthetic | true iff the event is caused by internal cache processing such as eviction or loading | |
nTransformState | the TransformationState describing how this event has been or should be transformed |
virtual bool isSynthetic | ( | ) | const [virtual] |
virtual TransformationState getTransformState | ( | ) | const [virtual] |
Return transformation state of this event.
Non-transformable events will not be delivered to MapEventTransformer MapEventTransformer listeners.