org.nodal.util
Class TxnMonitorableUtil

java.lang.Object
  extended byorg.nodal.util.TxnMonitorableUtil
All Implemented Interfaces:
TxnHandler, TxnMonitorable
Direct Known Subclasses:
GetterUtil

public class TxnMonitorableUtil
extends java.lang.Object
implements TxnMonitorable, TxnHandler

A class for

Author:
leei

Field Summary
protected  java.util.List handlers
           
 
Constructor Summary
protected TxnMonitorableUtil()
           
 
Method Summary
protected  void addNotifier()
          A method called when this class has TxnHandlers that need to be notified of a change.
 void addTxnHandler(TxnHandler handler)
          Add a TxnHandler to be invoked when this object changes.
 void notifyInsertAfter(NodeContent c, int index, java.lang.Object value)
           
 void notifyInsertBefore(NodeContent c, int index, java.lang.Object value)
           
 void notifyRemoveKey(NodeContent c, java.lang.Object key)
           
 void notifyRemoveRange(NodeContent c, int start, int end)
           
 void notifyReplaceRange(NodeContent c, int start, int end, java.lang.Object seq)
           
 void notifySetValue(NodeContent c, java.lang.Object property, java.lang.Object value)
           
protected  void removeNotifier()
          A method called when this class no longer has TxnHandlers that need to be notified of a change.
 void removeTxnHandler(TxnHandler handler)
          Remove a previously added TxnHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlers

protected java.util.List handlers
Constructor Detail

TxnMonitorableUtil

protected TxnMonitorableUtil()
Method Detail

addTxnHandler

public final void addTxnHandler(TxnHandler handler)
Description copied from interface: TxnMonitorable
Add a TxnHandler to be invoked when this object changes.

Specified by:
addTxnHandler in interface TxnMonitorable
Parameters:
handler - a TxnHandler whose notify methods will be invoked when this object changes.

removeTxnHandler

public final void removeTxnHandler(TxnHandler handler)
Description copied from interface: TxnMonitorable
Remove a previously added TxnHandler.

Specified by:
removeTxnHandler in interface TxnMonitorable
Parameters:
handler - a TxnHandler that has previously been added.

addNotifier

protected void addNotifier()
A method called when this class has TxnHandlers that need to be notified of a change. This method should be overridden by a subclass that needs to know when to include it as a possible target for notification.


removeNotifier

protected void removeNotifier()
A method called when this class no longer has TxnHandlers that need to be notified of a change. This method should be overridden by a subclass that needs to know when to no longer include it as a possible target for notification.


notifySetValue

public void notifySetValue(NodeContent c,
                           java.lang.Object property,
                           java.lang.Object value)
Specified by:
notifySetValue in interface TxnHandler

notifyInsertBefore

public void notifyInsertBefore(NodeContent c,
                               int index,
                               java.lang.Object value)
Specified by:
notifyInsertBefore in interface TxnHandler

notifyInsertAfter

public void notifyInsertAfter(NodeContent c,
                              int index,
                              java.lang.Object value)
Specified by:
notifyInsertAfter in interface TxnHandler

notifyRemoveKey

public void notifyRemoveKey(NodeContent c,
                            java.lang.Object key)
Specified by:
notifyRemoveKey in interface TxnHandler

notifyRemoveRange

public void notifyRemoveRange(NodeContent c,
                              int start,
                              int end)
Specified by:
notifyRemoveRange in interface TxnHandler

notifyReplaceRange

public void notifyReplaceRange(NodeContent c,
                               int start,
                               int end,
                               java.lang.Object seq)
Specified by:
notifyReplaceRange in interface TxnHandler