Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.1.0 E18814-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.util
Interface ObservableMap

All Superinterfaces:
  java.util.Map

All Known Subinterfaces:
  CacheMap, ConfigurableCacheMap, NamedCache, OptimisticNamedCache

All Known Implementing Classes:
  AbstractSerializationCache, BundlingNamedCache, ContinuousQueryCache, ConverterCollections.ConverterCacheMap, ConverterCollections.ConverterNamedCache, ConverterCollections.ConverterObservableMap, LocalCache, NearCache, NullImplementation.NullObservableMap, ObservableHashMap, ObservableSplittingBackingCache, ObservableSplittingBackingMap, OldCache, OverflowMap, ReadonlyNamedCache, ReadWriteBackingMap, ReadWriteSplittingBackingMap, SerializationCache, SerializationPagedCache, VersionedBackingMap, VersionedNearCache, WrapperConcurrentMap, WrapperNamedCache, WrapperObservableMap

      public interface ObservableMap

extends java.util.Map

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.

Author:
  gg 2002.02.11, cp 2003.05.21
See Also:
  `NamedCache`, `LocalCache`, `ObservableHashMap`

Nested Class Summary

Nested classes/interfaces inherited from interface java.util.Map
`java.util.Map.Entry`

Method Summary
`void` | `addMapListener(MapListener listener)` 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.
`void` | `addMapListener(MapListener listener, Filter filter, boolean fLite)` Add a map listener that receives events based on a filter evaluation.
`void` | `addMapListener(MapListener listener, java.lang.Object oKey, boolean fLite)` Add a map listener for a specific key.
`void` | `removeMapListener(MapListener listener)` Remove a standard map listener that previously signed up for all events.
`void` | `removeMapListener(MapListener listener, Filter filter)` Remove a map listener that previously signed up for events based on a filter evaluation.
`void` | `removeMapListener(MapListener listener, java.lang.Object oKey)` Remove a map listener that previously signed up for events about a specific key.

Methods inherited from interface java.util.Map
`clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

Method Detail

### addMapListener

    void addMapListener(MapListener listener)

  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:

         addMapListener(listener, (Filter) null, false);

  Parameters:
    `listener` - the `MapEvent` listener to add

### removeMapListener

    void removeMapListener(MapListener listener)

  Remove a standard map listener that previously signed up for all events. This has the same result as the following call:

         removeMapListener(listener, (Filter) null);

  Parameters:
    `listener` - the listener to remove

### addMapListener

    void addMapListener(MapListener listener,
                        java.lang.Object oKey,
                        boolean fLite)

  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:
    `listener` - the `MapEvent` listener to add
    `oKey` - 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
  Since:
    Coherence 2.3

### removeMapListener

    void removeMapListener(MapListener listener,
                           java.lang.Object oKey)

  Remove a map listener that previously signed up for events about a specific key.
  Parameters:
    `listener` - the listener to remove
    `oKey` - the key that identifies the entry for which to raise events
  Since:
    Coherence 2.3

### addMapListener

    void addMapListener(MapListener listener,
                        Filter filter,
                        boolean fLite)

  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:
    `listener` - the `MapEvent` listener to add
    `filter` - a 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 `MapEventFilter`); null is equivalent to a filter that alway returns true
    `fLite` - true to indicate that the `MapEvent` objects do not have to include the OldValue and NewValue property values in order to allow optimizations
  Since:
    Coherence 2.3

### removeMapListener

    void removeMapListener(MapListener listener,
                           Filter filter)

  Remove a map listener that previously signed up for events based on a filter evaluation.
  Parameters:
    `listener` - the listener to remove
    `filter` - the filter that was passed into the corresponding addMapListener() call
  Since:
    Coherence 2.3

Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.1.0 E18814-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.