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

E47891-01

ObservableMap Class Reference

#include <coherence/util/ObservableMap.hpp>

Inherits Map.

Inherited by OldCache [virtual], NamedCache [virtual], ConverterCollections::ConverterObservableMap [virtual], and NullImplementation::NullObservableMap [virtual].

List of all members.


Detailed Description

ObservableMap interface represents an object with a model being a Map that allows for pluggable notifications for occuring changes.

This is primarily intended for maps that have automatic pruning and purging strategies or maps that are asynchronously modified by different threads.

Starting from Coherence 2.3 it supports optimizations that optionally do not require the map values to be included in the map events, allowing a "lite" event to be delivered and saving memory, processing and bandwidth for distributed applications.

See also:
NamedCache

LocalCache

ObservableHashMap

Author:
js 2008.06.04

Public Types

typedef spec::Handle Handle
 ObservableMap Handle definition.
typedef spec::View View
 ObservableMap View definition.
typedef spec::Holder Holder
 ObservableMap Holder definition.

Public Member Functions

virtual void addKeyListener (MapListener::Handle hListener, Object::View vKey, bool fLite)=0
 Add a map listener for a specific key.
virtual void removeKeyListener (MapListener::Handle hListener, Object::View vKey)=0
 Remove a map listener that previously signed up for events about a specific key.
virtual void addMapListener (MapListener::Handle hListener)=0
 Add a standard map listener that will receive all events (inserts, updates, deletes) that occur against the map, with the key, old-value and new-value included.
virtual void removeMapListener (MapListener::Handle hListener)=0
 Remove a standard map listener that previously signed up for all events.
virtual void addFilterListener (MapListener::Handle hListener, Filter::View vFilter=NULL, bool fLite=false)=0
 Add a map listener that receives events based on a filter evaluation.
virtual void removeFilterListener (MapListener::Handle hListener, Filter::View vFilter=NULL)=0
 Remove a map listener that previously signed up for events based on a filter evaluation.

Member Function Documentation

virtual void addKeyListener ( MapListener::Handle  hListener,
Object::View  vKey,
bool  fLite 
) [pure virtual]

Add a map listener for a specific key.

The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.

To unregister the MapListener, use the removeKeyListener(MapListener, Object) method.

Parameters:
hListener the MapEvent listener to add
vKey the key that identifies the entry for which to raise events
fLite true to indicate that the MapEvent objects do not have to include the OldValue and NewValue property values in order to allow optimizations

Implemented in ConverterCollections::ConverterObservableMap.

virtual void removeKeyListener ( MapListener::Handle  hListener,
Object::View  vKey 
) [pure virtual]

Remove a map listener that previously signed up for events about a specific key.

Parameters:
hListener the listener to remove
vKey the key that identifies the entry for which to raise events

Implemented in ConverterCollections::ConverterObservableMap.

virtual void addMapListener ( MapListener::Handle  hListener  )  [pure virtual]

Add a standard map listener that will receive all events (inserts, updates, deletes) that occur against the map, with the key, old-value and new-value included.

This has the same result as the following call:

   addFilterListener(hListener, (Filter::View) NULL, false);

Parameters:
hListener the MapEvent listener to add
Since:
Coherence 12.1.3

Implemented in ConverterCollections::ConverterObservableMap.

virtual void removeMapListener ( MapListener::Handle  hListener  )  [pure virtual]

Remove a standard map listener that previously signed up for all events.

This has the same result as the following call:

   removeFilterListener(hListener, (Filter::View) NULL);

Parameters:
hListener the listener to remove
Since:
Coherence 12.1.3

Implemented in ConverterCollections::ConverterObservableMap.

virtual void addFilterListener ( MapListener::Handle  hListener,
Filter::View  vFilter = NULL,
bool  fLite = false 
) [pure virtual]

Add a map listener that receives events based on a filter evaluation.

The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.

To unregister the MapListener, use the removeFilterListener(MapListener, Filter) method.

Parameters:
hListener the MapEvent listener to add
vFilter an optional filter that will be passed MapEvent objects to select from; a MapEvent will be delivered to the listener only if the filter evaluates to true for that MapEvent (see {com.tangosol.util.filter.MapEventFilter}); NULL is equivalent to a filter that alway returns true
fLite an optional parameter where true indicates that the {MapEvent} objects do not have to include the OldValue and NewValue property values in order to allow optimizations; default value is false

Implemented in ConverterCollections::ConverterObservableMap.

virtual void removeFilterListener ( MapListener::Handle  hListener,
Filter::View  vFilter = NULL 
) [pure virtual]

Remove a map listener that previously signed up for events based on a filter evaluation.

Parameters:
hListener the listener to remove
vFilter the optional filter that was passed into the corresponding addFilterListener() call; defaults to NULL

Implemented in ConverterCollections::ConverterObservableMap.


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