Class OortMap.DeltaListener<K,V>

java.lang.Object
org.cometd.oort.OortMap.DeltaListener<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
EventListener, OortObject.Listener<ConcurrentMap<K,V>>
Enclosing class:
OortMap<K,V>

public static class OortMap.DeltaListener<K,V> extends Object implements OortObject.Listener<ConcurrentMap<K,V>>

An implementation of OortObject.Listener that converts whole map events into OortMap.EntryListener events.

For example, if an entity map:

{
    key0: value0,
    key1: value1,
    key2: value2
}

is replaced by a map:

{
    key0: value0,
    key1: valueA,
    key3: valueB
}

then this listener generates two "put" events with the following entries:

(key1, value1, valueA)
(key3, null, valueB)

and one "remove" event with the following entry:

(key2, value2, null)

Note that no event is emitted for key0; the values for key0 of the two maps are tested via Object.equals(Object) and if they are equal no event is generated.