#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.
Not all cache service types support the dispatching of synthetic events. Synthetic events will only be dispatched by a partitioned cache service and its derivatives, such as a federated cache service, or by near, view, or remote caches that are backed by a cache service that supports the dispatching of synthetic events. In all other cases, no event will be dispatched for synthetic events such as expiry.
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 bool | isPriming () const | |||
| Return true iff this event is caused by a priming listener registration. | ||||
| virtual bool | isExpired () const | |||
| Return true iff this event is caused by an entry eviction due to time limit reached. | ||||
| 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, bool fPriming) | ||||
| 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. | ||||
| CacheEvent (ObservableMap::Handle hMap, int32_t nId, Object::View voKey, Object::View voValueOld, Object::View voValueNew, bool fSynthetic, TransformationState nTransformState, bool fPriming) | ||||
| Create a new CacheEvent. | ||||
| CacheEvent (ObservableMap::Handle hMap, int32_t nId, Object::View voKey, Object::View voValueOld, Object::View voValueNew, bool fSynthetic, TransformationState nTransformState, bool fPriming, bool fExpired) | ||||
| Constructs a new CacheEvent. | ||||
| virtual bool | shouldDispatch (TypedHandle< const MapListener > vListener) const | |||
| Return true if the provided MapListener should receive this event.
| ||||
Protected Attributes | ||||
| bool | m_fSynthetic | |||
| Event cause flag. | ||||
| TransformationState | m_nTransformState | |||
| The TransformationState for this event. | ||||
| bool | m_fPriming | |||
| Flag indicating whether or not the event is a priming event (NearCache). | ||||
| bool | m_fExpired | |||
| Flag indicating whether the deletion event is a result of time expiration. | ||||
| 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, | |||
| bool | fPriming | |||
| ) | [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 | |
| fPriming | a flag indicating whether or not the event is a priming event |
| 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 |
| CacheEvent | ( | ObservableMap::Handle | hMap, | |
| int32_t | nId, | |||
| Object::View | voKey, | |||
| Object::View | voValueOld, | |||
| Object::View | voValueNew, | |||
| bool | fSynthetic, | |||
| TransformationState | nTransformState, | |||
| bool | fPriming | |||
| ) | [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 | |
| fPriming | a flag indicating whether or not the event is a priming event |
| CacheEvent | ( | ObservableMap::Handle | hMap, | |
| int32_t | nId, | |||
| Object::View | voKey, | |||
| Object::View | voValueOld, | |||
| Object::View | voValueNew, | |||
| bool | fSynthetic, | |||
| TransformationState | nTransformState, | |||
| bool | fPriming, | |||
| bool | fExpired | |||
| ) | [protected] |
Constructs a new CacheEvent.
| map | the ObservableMap object that fired the event | |
| nId | this event's id, one of (entry_inserted | entry_updated | entry_deleted) | |
| oKey | the key into the map | |
| oValueOld | the old value (for update and delete events) | |
| oValueNew | the new value (for insert and update events) | |
| fSynthetic | true iff the event is caused by the cache internal processing such as eviction or loading | |
| transformState | the TransformationState describing how this event has been or should be transformed | |
| fPriming | a flag indicating whether or not the event is a priming event | |
| fExpired | true iff the event results from an eviction due to time |
| 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.
| virtual bool isPriming | ( | ) | const [virtual] |
Return true iff this event is caused by a priming listener registration.
| virtual bool isExpired | ( | ) | const [virtual] |
Return true iff this event is caused by an entry eviction due to time limit reached.
In this case the event will also be synthetic.
bool m_fPriming [protected] |
bool m_fExpired [protected] |
Flag indicating whether the deletion event is a result of time expiration.