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

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

Protected Attributes

bool m_fSynthetic
 Event cause flag.

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 occurred
nId 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


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


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