Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47891-01

CacheEvent Class Reference

#include <coherence/net/cache/CacheEvent.hpp>

Inherits MapEvent.

Inherited by ConverterCollections::ConverterCacheEvent, and MapListenerSupport::FilterEvent.

List of all members.


Detailed Description

An extension of the MapEvent which allows to differentiate between client driven (natural) events and cache internal (synthetic) events.

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.

Author:
js 2008.06.06

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 void outputDescription (std::ostream &out) const
 Output a human-readable description of the state of this class in the form of a delimited list of name-value pairs.

Generally it is also advisable to start with a call to super::outputDescription(out)

The default implementation does not output anything to the stream.

Parameters:
out the stream to output the description to


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.

Member Enumeration Documentation

enum TransformationState

Transformation state constants.

TransformationState describes how a CacheEvent has been or should be transformed.

Enumerator:
non_transformable  Value used to indicate that an event is non-transformable and should not be passed to any transformer-based listeners.
transformable  Value used to indicate that an event is transformable and could be passed to transformer-based listeners.
transformed  Value used to indicate that an event has been transformed, and should only be passed to transformer-based listeners.


Constructor & Destructor Documentation

CacheEvent ( ObservableMap::Handle  hMap,
int32_t  nId,
Object::View  voKey,
Object::View  voValueOld,
Object::View  voValueNew,
bool  fSynthetic 
) [protected]

Create a new CacheEvent.

Parameters:
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.

Parameters:
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
Since:
Coherence 3.7.1.9


Member Function Documentation

virtual bool isSynthetic (  )  const [virtual]

Return true iff this event is caused by internal cache processing such as eviction or loading.

Returns:
true iff this event is caused by internal cache processing

virtual TransformationState getTransformState (  )  const [virtual]

Return transformation state of this event.

Non-transformable events will not be delivered to MapEventTransformer MapEventTransformer listeners.

Returns:
the TransformationState for this event


The documentation for this class was generated from the following file:
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.