K
- the key typeV
- the value typejava.util.EventListener
, OortObject.Listener<java.util.concurrent.ConcurrentMap<K,V>>
public static class OortMap.DeltaListener<K,V> extends java.lang.Object implements OortObject.Listener<java.util.concurrent.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.
OortObject.Listener.Adapter<T>
Constructor | Description |
---|---|
DeltaListener(OortMap<K,V> oortMap) |
Modifier and Type | Method | Description |
---|---|---|
void |
onRemoved(OortObject.Info<java.util.concurrent.ConcurrentMap<K,V>> info) |
Callback method invoked when the object value is removed, for example
because the correspondent node has been shut down or crashed.
|
void |
onUpdated(OortObject.Info<java.util.concurrent.ConcurrentMap<K,V>> oldInfo,
OortObject.Info<java.util.concurrent.ConcurrentMap<K,V>> newInfo) |
Callback method invoked when the object value is updated.
|
public void onUpdated(OortObject.Info<java.util.concurrent.ConcurrentMap<K,V>> oldInfo, OortObject.Info<java.util.concurrent.ConcurrentMap<K,V>> newInfo)
OortObject.Listener
onUpdated
in interface OortObject.Listener<K>
oldInfo
- the OortObject.Info
before the change, may be nullnewInfo
- the OortObject.Info
after the changepublic void onRemoved(OortObject.Info<java.util.concurrent.ConcurrentMap<K,V>> info)
OortObject.Listener
onRemoved
in interface OortObject.Listener<K>
info
- the OortObject.Info
before the removalCopyright © 2008–2017 The CometD Project. All rights reserved.