ca.sqlpower.wabit
Class AbstractWabitListener

java.lang.Object
  extended by ca.sqlpower.wabit.AbstractWabitListener
All Implemented Interfaces:
WabitListener, java.beans.PropertyChangeListener, java.util.EventListener

public abstract class AbstractWabitListener
extends java.lang.Object
implements WabitListener

Extend this class to add the behaviour to not respond to events when in a transaction. Instead of responding to events while in a transaction the listener will collect the events and then at the end of the transaction act on each event in the order it was received. If a rollback event was received the events will be discarded instead.


Constructor Summary
AbstractWabitListener()
           
 
Method Summary
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
protected  void propertyChangeImpl(java.beans.PropertyChangeEvent evt)
          Override this method if an action is required when a property change event is acted upon.
 void transactionEnded(ca.sqlpower.util.TransactionEvent e)
          Signals a transaction has finished.
protected  void transactionEndedImpl(ca.sqlpower.util.TransactionEvent e)
          Override this method if an action is required when a transaction ends.
 void transactionRollback(ca.sqlpower.util.TransactionEvent e)
          Signals a transaction has finished and the events that occurred during the transaction need to be reversed or not acted upon.
protected  void transactionRollbackImpl(ca.sqlpower.util.TransactionEvent e)
          Override this method if an action is required when a transaction rolls back.
 void transactionStarted(ca.sqlpower.util.TransactionEvent e)
          Called when a transaction has started.
protected  void transactionStartedImpl(ca.sqlpower.util.TransactionEvent e)
          Override this method if an action is required when a transaction starts.
 void wabitChildAdded(WabitChildEvent e)
          Called when a child is added to an object this listener is attached to.
protected  void wabitChildAddedImpl(WabitChildEvent e)
          Override this method if an action is required when a child added event is acted upon.
 void wabitChildRemoved(WabitChildEvent e)
          Called when a child is removed from an object this listener is attached to.
protected  void wabitChildRemovedImpl(WabitChildEvent e)
          Override this method if an action is required when a child removed event is acted upon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWabitListener

public AbstractWabitListener()
Method Detail

transactionEnded

public final void transactionEnded(ca.sqlpower.util.TransactionEvent e)
Description copied from interface: WabitListener
Signals a transaction has finished. The events that occurred during the transaction should be considered one atomic operation. By the time the transaction ends in this fashion or immediately after the atomic operation should be acted upon. Some transactions may be nested inside of other transactions. In this case the transaction is finished only when the outer most transaction has completed.

Specified by:
transactionEnded in interface WabitListener
Parameters:
e - Contains the object that has finished a transaction.

transactionEndedImpl

protected void transactionEndedImpl(ca.sqlpower.util.TransactionEvent e)
Override this method if an action is required when a transaction ends. This will be called when any transactionEnded event is fired, even if it is the end of a transaction that is contained in another transaction.


transactionRollback

public final void transactionRollback(ca.sqlpower.util.TransactionEvent e)
Description copied from interface: WabitListener
Signals a transaction has finished and the events that occurred during the transaction need to be reversed or not acted upon. If a transaction inside of another transaction rolls back both the inner and outer transaction will be rolled back.

Specified by:
transactionRollback in interface WabitListener
Parameters:
e - Contains the object that was rolled back and a message describing why the transaction was rolled back.

transactionRollbackImpl

protected void transactionRollbackImpl(ca.sqlpower.util.TransactionEvent e)
Override this method if an action is required when a transaction rolls back.


transactionStarted

public final void transactionStarted(ca.sqlpower.util.TransactionEvent e)
Description copied from interface: WabitListener
Called when a transaction has started. The events fired after the transaction started until the transaction has ended or rolled back should be considered one atomic operation.

Specified by:
transactionStarted in interface WabitListener
Parameters:
e - Contains what object started a transaction and a message describing the transaction.

transactionStartedImpl

protected void transactionStartedImpl(ca.sqlpower.util.TransactionEvent e)
Override this method if an action is required when a transaction starts. This will be called when any transactionStarted event is fired, even if it is the start of a transaction that is contained in another transaction.


wabitChildAdded

public final void wabitChildAdded(WabitChildEvent e)
Description copied from interface: WabitListener
Called when a child is added to an object this listener is attached to.

Specified by:
wabitChildAdded in interface WabitListener
Parameters:
e - An event describing the child added.

wabitChildAddedImpl

protected void wabitChildAddedImpl(WabitChildEvent e)
Override this method if an action is required when a child added event is acted upon.


wabitChildRemoved

public final void wabitChildRemoved(WabitChildEvent e)
Description copied from interface: WabitListener
Called when a child is removed from an object this listener is attached to.

Specified by:
wabitChildRemoved in interface WabitListener
Parameters:
e - An event describing the child removed.

wabitChildRemovedImpl

protected void wabitChildRemovedImpl(WabitChildEvent e)
Override this method if an action is required when a child removed event is acted upon.


propertyChange

public final void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

propertyChangeImpl

protected void propertyChangeImpl(java.beans.PropertyChangeEvent evt)
Override this method if an action is required when a property change event is acted upon.



Copyright © 2009. All Rights Reserved.