DJAVA

au.gov.aao.drama
Class DramaPath.ResponseHandler

java.lang.Object
  extended by au.gov.aao.drama.DramaPath.ResponseHandler
Direct Known Subclasses:
DramaMonitor
Enclosing class:
DramaPath

public static class DramaPath.ResponseHandler
extends Object

A class which handles responding to DRAMA messages initiated using a DramaPath object.

This class provides default handling for replies for messages sent using a DramaPath object. Applications should override the Success, Error, Trigger, Ers and Msg methods as required to implement their required handling of these replies.

The DramaPath.RescheduleHandler class examines every message it receives and if that message is a reply to a message sent by this task and it refers to a class derived from this class, then the RescheduleHandler object uses the methods of this class to handle those message replies.

See Also:
DramaPath, DramaPath.RescheduleHandler

Constructor Summary
DramaPath.ResponseHandler(DramaPath p)
          Construct a DramaPath.ResponseHandler object.
 
Method Summary
 boolean Error(DramaPath path, DramaTask task)
          Invoked when a message has completed with error.
 boolean Ers(DramaPath path, DramaTask task)
          Invoked when a Ers message has been received.
 void Forget()
          Forget this transaction.
 boolean Forgotten()
          Has this transaction been forgotten?
 boolean Msg(DramaPath path, DramaTask task)
          Invoked when a MsgOut message has been received.
 boolean Success(DramaPath path, DramaTask task)
          Invoked when a message has completed sucessfully.
 boolean Trigger(DramaPath path, DramaTask task)
          Invoked when a trigger message has been received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DramaPath.ResponseHandler

public DramaPath.ResponseHandler(DramaPath p)
Construct a DramaPath.ResponseHandler object.

Parameters:
p - The DramPath object involved in the transaction.
Method Detail

Forget

public final void Forget()
Forget this transaction.

Used by the Forget versions of the message sending routines to trigger forgetting of a transaction.


Forgotten

public final boolean Forgotten()
Has this transaction been forgotten?


Success

public boolean Success(DramaPath path,
                       DramaTask task)
                throws DramaException
Invoked when a message has completed sucessfully.

This method can be overriden by sub-classes to get notification of successful completion of messages. It should return true if another message has been sent and false if not.

Note When used in its intended way, this method is always invoked in the DRAMA thread and with the DRAMA semaphore taken. Please see thread Issues for important information, particuarly if you are updating Swing widgets from your implemention of this method.

Parameters:
path - The DramaPath object for the path of the message.
task - The DramaTask object.
Throws:
DramaException - Thrown on errors in the DRAMA code.

Error

public boolean Error(DramaPath path,
                     DramaTask task)
              throws DramaException
Invoked when a message has completed with error.

This method can be overriden by sub-classes to get notification of error completion of messages. It should return true if another message has been sent and false if not.

Note When used in its intended way, this method is always invoked in the DRAMA thread and with the DRAMA semaphore taken. Please see thread Issues for important information, particuarly if you are updating Swing widgets from your implemention of this method.

Parameters:
path - The DramaPath object for the path of the message.
task - The DramaTask object.
Throws:
DramaException - Thrown on errors in the DRAMA code.

Trigger

public boolean Trigger(DramaPath path,
                       DramaTask task)
                throws DramaException
Invoked when a trigger message has been received.

This method can be overriden by sub-classes to get notification of trigger messages. It should return true if another message has been sent and false if not.

Note When used in its intended way, this method is always invoked in the DRAMA thread and with the DRAMA semaphore taken. Please see thread Issues for important information, particuarly if you are updating Swing widgets from your implemention of this method.

Parameters:
path - The DramaPath object for the path of the message.
task - The DramaTask object.
Throws:
DramaException - Thrown on errors in the DRAMA code.

Msg

public boolean Msg(DramaPath path,
                   DramaTask task)
            throws DramaException
Invoked when a MsgOut message has been received.

This method can be overriden by sub-classes to get notification of MsgOut messages. It should return true if another message has been sent and false if not.

These are normally only received by UFACE transactions.

Note When used in its intended way, this method is always invoked in the DRAMA thread and with the DRAMA semaphore taken. Please see thread Issues for important information, particuarly if you are updating Swing widgets from your implemention of this method.

Parameters:
path - The DramaPath object for the path of the message.
task - The DramaTask object.
Throws:
DramaException - Thrown on errors in the DRAMA code.

Ers

public boolean Ers(DramaPath path,
                   DramaTask task)
            throws DramaException
Invoked when a Ers message has been received.

This method can be overriden by sub-classes to get notification of Ers messages. It should return true if another message has been sent and false if not.

These are normally only received by UFACE transactions.

Note When used in its intended way, this method is always invoked in the DRAMA thread and with the DRAMA semaphore taken. Please see thread Issues for important information, particuarly if you are updating Swing widgets from your implemention of this method.

Parameters:
path - The DramaPath object for the path of the message.
task - The DramaTask object.
Throws:
DramaException - Thrown on errors in the DRAMA code.

DJAVA

Click here for the DRAMA home page and here for the AAO home page.

For more information, contact tjf@aaoepp.aao.gov.au.