net.aerith.misao.util
Class OperationObservable

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
Direct Known Subclasses:
CatalogTreeManager, GlobalDBManager, Operation, ThumbnailImageCreater

public abstract class OperationObservable
extends java.lang.Object

The OperationObservable represents an object with an operation whose progress is observable.


Field Summary
protected  java.util.Vector observer_list
          The list of observers.
 
Constructor Summary
OperationObservable()
           
 
Method Summary
 void addObserver(OperationObserver observer)
          Adds an observer.
 void deleteObserver(OperationObserver observer)
          Removes an observer.
protected  void notifyEnd(java.lang.Exception exception)
          Notifies when the operation ends.
protected  void notifyFailed(java.lang.Object arg)
          Notifies when a task is failed.
protected  void notifyStart()
          Notifies when the operation starts.
protected  void notifySucceeded(java.lang.Object arg)
          Notifies when a task is succeeded.
protected  void notifyWarned(java.lang.Object arg)
          Notifies 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

observer_list

protected java.util.Vector observer_list
The list of observers.
Constructor Detail

OperationObservable

public OperationObservable()
Method Detail

addObserver

public void addObserver(OperationObserver observer)
Adds an observer.
Parameters:
observer - an observer

deleteObserver

public void deleteObserver(OperationObserver observer)
Removes an observer.
Parameters:
observer - an observer

notifyStart

protected void notifyStart()
Notifies when the operation starts.

notifyEnd

protected void notifyEnd(java.lang.Exception exception)
Notifies when the operation ends.
Parameters:
exception - the exception if an error occurs, or null if succeeded.

notifySucceeded

protected void notifySucceeded(java.lang.Object arg)
Notifies when a task is succeeded.
Parameters:
arg - the argument.

notifyFailed

protected void notifyFailed(java.lang.Object arg)
Notifies when a task is failed.
Parameters:
arg - the argument.

notifyWarned

protected void notifyWarned(java.lang.Object arg)
Notifies when a task is warned.
Parameters:
arg - the argument.