net.aerith.misao.util
Class DefaultOperationObserver

java.lang.Object
  |
  +--net.aerith.misao.util.DefaultOperationObserver

public class DefaultOperationObserver
extends java.lang.Object
implements OperationObserver

The DefaultOperationObserver represents an observer of several tasks in one operation, which remembers the succeeded and failed tasks.


Field Summary
protected  java.util.Vector failed_list
          The list of failed tasks.
protected  java.util.Vector succeeded_list
          The list of succeeded tasks.
protected  java.util.Vector warned_list
          The list of warned tasks.
 
Constructor Summary
DefaultOperationObserver()
           
 
Method Summary
 java.util.Vector getFailedList()
          Gets the list of failed tasks.
 java.util.Vector getSucceededList()
          Gets the list of succeeded tasks.
 java.util.Vector getWarnedList()
          Gets the list of warned tasks.
 void notifyEnd(java.lang.Exception exception)
          Invoked when the operation ends.
 void notifyFailed(java.lang.Object arg)
          Invoked when a task is failed.
 void notifyStart()
          Invoked when the operation starts.
 void notifySucceeded(java.lang.Object arg)
          Invoked when a task is succeeded.
 void notifyWarned(java.lang.Object arg)
          Invoked when a task is warned.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

succeeded_list

protected java.util.Vector succeeded_list
The list of succeeded tasks.

failed_list

protected java.util.Vector failed_list
The list of failed tasks.

warned_list

protected java.util.Vector warned_list
The list of warned tasks.
Constructor Detail

DefaultOperationObserver

public DefaultOperationObserver()
Method Detail

notifyStart

public void notifyStart()
Invoked when the operation starts.
Specified by:
notifyStart in interface OperationObserver

notifyEnd

public void notifyEnd(java.lang.Exception exception)
Invoked when the operation ends.
Specified by:
notifyEnd in interface OperationObserver
Parameters:
exception - the exception if an error occurs, or null if succeeded.

notifySucceeded

public void notifySucceeded(java.lang.Object arg)
Invoked when a task is succeeded.
Specified by:
notifySucceeded in interface OperationObserver
Parameters:
arg - the argument.

notifyFailed

public void notifyFailed(java.lang.Object arg)
Invoked when a task is failed.
Specified by:
notifyFailed in interface OperationObserver
Parameters:
arg - the argument.

notifyWarned

public void notifyWarned(java.lang.Object arg)
Invoked when a task is warned.
Specified by:
notifyWarned in interface OperationObserver
Parameters:
arg - the argument.

getSucceededList

public java.util.Vector getSucceededList()
Gets the list of succeeded tasks.
Returns:
the list of succeeded tasks.

getFailedList

public java.util.Vector getFailedList()
Gets the list of failed tasks.
Returns:
the list of failed tasks.

getWarnedList

public java.util.Vector getWarnedList()
Gets the list of warned tasks.
Returns:
the list of warned tasks.