Package org.cometd.oort
Class OortList.DeltaListener<E>
- java.lang.Object
-
- org.cometd.oort.OortList.DeltaListener<E>
-
- Type Parameters:
E
- the element type
- All Implemented Interfaces:
java.util.EventListener
,OortObject.Listener<java.util.List<E>>
public static class OortList.DeltaListener<E> extends java.lang.Object implements OortObject.Listener<java.util.List<E>>
An implementation of
OortObject.Listener
that converts whole list events intoOortList.ElementListener
events.For example, if an entity list:
[A, B]
is replaced by a list:
[A, C, D]
then this listener generates two "add" events for
C
andD
and one "remove" event forB
.
-
-
Constructor Summary
Constructors Constructor Description DeltaListener(OortList<E> oortList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onRemoved(OortObject.Info<java.util.List<E>> 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.List<E>> oldInfo, OortObject.Info<java.util.List<E>> newInfo)
Callback method invoked when the object value is updated.
-
-
-
Method Detail
-
onUpdated
public void onUpdated(OortObject.Info<java.util.List<E>> oldInfo, OortObject.Info<java.util.List<E>> newInfo)
Description copied from interface:OortObject.Listener
Callback method invoked when the object value is updated.- Specified by:
onUpdated
in interfaceOortObject.Listener<E>
- Parameters:
oldInfo
- theOortObject.Info
before the change, may be nullnewInfo
- theOortObject.Info
after the change
-
onRemoved
public void onRemoved(OortObject.Info<java.util.List<E>> info)
Description copied from interface:OortObject.Listener
Callback method invoked when the object value is removed, for example because the correspondent node has been shut down or crashed.- Specified by:
onRemoved
in interfaceOortObject.Listener<E>
- Parameters:
info
- theOortObject.Info
before the removal
-
-