ObservableMap Class Reference

#include <coherence/util/ObservableMap.hpp>

Inherits Map.

Inherited by 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:
com.tangosol.net.NamedCache

com.tangosol.net.cache.LocalCache

com.tangosol.util.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 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 removeMapListener(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 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 {removeMapListener(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 addMapListener() call; defaults to NULL

Implemented in ConverterCollections::ConverterObservableMap.


The documentation for this class was generated from the following file: Copyright (c) 2000-2008 Oracle. All rights reserved.