edu.cuny.cat.task
Class DispatchingTask

java.lang.Object
  extended by java.util.Observable
      extended by edu.cuny.cat.task.DispatchingTask
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
EventDispatchingTask, MessageDispatchingTask

public abstract class DispatchingTask
extends java.util.Observable
implements java.lang.Runnable

Defines the interface for the task of dispatching events or messages to specified receivers. It is observable and its observers are notified if the task fails to accomplish.

Version:
$Revision: 1.2 $
Author:
Jinzhong Niu

Field Summary
 int tid
          an integer uniquely identifying this task and also providing a way to sort tasks as the order they are created
 
Constructor Summary
DispatchingTask()
           
 
Method Summary
 void failedOn(java.lang.Object receiver)
          notifies the observers of the failure of dispatching to the specified receiver.
 java.lang.String toString()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

tid

public int tid
an integer uniquely identifying this task and also providing a way to sort tasks as the order they are created

Constructor Detail

DispatchingTask

public DispatchingTask()
Method Detail

failedOn

public void failedOn(java.lang.Object receiver)
notifies the observers of the failure of dispatching to the specified receiver.

Parameters:
receiver - the receiver involved in the failure

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object