|
DJAVA | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectau.gov.aao.drama.DramaPath.RescheduleHandler
public static class DramaPath.RescheduleHandler
A class which handles rescheduling of a DRAMA Action using the DramaPath class to messages to other DRAMA tasks.
You should derived from this class to implement your own handling where necessary by overriding NotHandled, OrphanHandler, Finished, Timeout, Signal, ThreadError or SystemError as you require. Where a reschedule event is a reply to a message sent by this task and the message has aResponseHandler assoicated with it,
that object is used to handle the reschedule event.
DramaPath,
DramaPath.ResponseHandler| Constructor Summary | |
|---|---|
DramaPath.RescheduleHandler()
Default Reschedule handler constructor. |
|
DramaPath.RescheduleHandler(boolean b)
Constructor which initialises threadCount to zero. |
|
DramaPath.RescheduleHandler(boolean b,
double t)
Constructor which allows setting of timeout and clearing threadCount. |
|
DramaPath.RescheduleHandler(double t)
Constructors which allows timeout to be set. |
|
DramaPath.RescheduleHandler(double t,
boolean b)
Constructor which allows setting of timeout and clearing threadCount. |
|
DramaPath.RescheduleHandler(DramaTask task)
Reschedule handler constructor which does a implicit Enable(). |
|
DramaPath.RescheduleHandler(DramaTask task,
boolean b)
Reschedule handler constructor which does a implicit Enable() and sets thread count to 0. |
|
DramaPath.RescheduleHandler(DramaTask task,
boolean b,
double t)
Reschedule handler constructor which does a implicit Enable(), sets timeout and zero's thread count. |
|
DramaPath.RescheduleHandler(DramaTask task,
double t)
Reschedule handler constructor which does a implicit Enable() and allows timeout to be set. |
|
DramaPath.RescheduleHandler(DramaTask task,
double t,
boolean b)
Reschedule handler constructor which does a implicit Enable(), sets timeout and zero's thread count. |
|
| Method Summary | |
|---|---|
void |
Enable(DramaTask task)
Enable this reschedule handler. |
void |
Finished(DramaTask task)
Invoked when the last DRAMA message thread has finished. |
void |
NewThread()
Increment the thread count, indicating another thread of messages is being controlled by this RecheduleHandler object. |
void |
NotHandled(DramaTask task)
Invoked if we received a message which we could not dispatch to a handler because there was no handler assocaited with the transaction. |
void |
Obey(DramaTask task)
Implement DramaTask.Action's obey handler. |
void |
OrphanHandler(DramaTask task)
Invoked if we receive a message which we could not dispatch to a handler due to it being orphanded (but not forgotten). |
void |
SetTimeout(double t)
Explicty set or reset the timeout assoicated with the reschedule handler. |
boolean |
Signal(DramaTask task)
Invoked on a Signal (DramaTask.EntReason == REA_SIGNAL). |
void |
SystemError(DramaTask task,
DramaException exception)
Invoked if there is an overall error whilst handling reschedule messages (an exception has been thrown). |
void |
ThreadError(DramaTask task,
DramaException exception)
Invoked if an error occurs dispatching a thread. |
boolean |
Timeout(DramaTask task)
Invoked on a timeout whilst waiting for messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DramaPath.RescheduleHandler()
public DramaPath.RescheduleHandler(double t)
t - The timeout in seconds. Timeout will be invoked
if no message is received in this time.public DramaPath.RescheduleHandler(boolean b)
b - Not used, just indicates the particular constructor.
public DramaPath.RescheduleHandler(double t,
boolean b)
t - The timeout in seconds. Timeout will be invoked
if no message is received in this time.b - Not used, just indicates the particular constructor.
public DramaPath.RescheduleHandler(boolean b,
double t)
b - Not used, just indicates the particular constructor.t - The timeout in seconds. Timeout will be invoked
if no message is received in this time.
public DramaPath.RescheduleHandler(DramaTask task)
throws DramaException
task - The task to invoke PutObeyHandler() with.
DramaException
public DramaPath.RescheduleHandler(DramaTask task,
double t)
throws DramaException
task - The task to invoke PutObeyHandler() with.t - The timeout in seconds. Timeout will be invoked
if no message is received in this time.
DramaException - Thrown on errors in the DRAMA code.
public DramaPath.RescheduleHandler(DramaTask task,
boolean b)
throws DramaException
b - Not used, just indicates the particular constructor.task - The task to invoke PutObeyHandler() with.
DramaException - Thrown on errors in the DRAMA code.
public DramaPath.RescheduleHandler(DramaTask task,
double t,
boolean b)
throws DramaException
task - The task to invoke PutObeyHandler() with.t - The timeout in seconds. Timeout will be invoked
if no message is received in this time.b - Not used, just indicates the particular constructor.
DramaException - Thrown on errors in the DRAMA code.
public DramaPath.RescheduleHandler(DramaTask task,
boolean b,
double t)
throws DramaException
task - The task to invoke PutObeyHandler() with.t - The timeout in seconds. Timeout will be invoked
if no message is received in this time.b - Not used, just indicates the particular constructor.
DramaException - Thrown on errors in the DRAMA code.| Method Detail |
|---|
public void Enable(DramaTask task)
throws DramaException
task - The task to invoke PutObeyHandler() with.
DramaException - Thrown on errors in the DRAMA code.public void SetTimeout(double t)
t - The new reschedule timeoutpublic void NewThread()
public final void Obey(DramaTask task)
throws DramaException
Obey in interface DramaTask.Actiontask - The task which received the message
DramaException - Thrown on errors in the DRAMA code.DramaTask.Action
public void NotHandled(DramaTask task)
throws DramaException
task - The task which received the message
DramaException - Thrown on errors in the DRAMA code.
public void OrphanHandler(DramaTask task)
throws DramaException
task - The task which received the message
DramaException - Thrown on errors in the DRAMA code.
public void Finished(DramaTask task)
throws DramaException
task - The task which received the message
DramaException - Thrown on errors in the DRAMA code.
public boolean Timeout(DramaTask task)
throws DramaException
The default behaviour is to throw an exception.
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.
task - The task which received the message
DramaException - Thrown on errors in the DRAMA code.
public boolean Signal(DramaTask task)
throws DramaException
task - The task which received the message
DramaException - Thrown on errors in the DRAMA code.
public void ThreadError(DramaTask task,
DramaException exception)
throws DramaException
task - The task which received the message
DramaException - Thrown on errors in the DRAMA code.
public void SystemError(DramaTask task,
DramaException exception)
throws DramaException
DramaException.Report and then
throws the exception.
For Actions, the result is that the action completes and the DRAMA status
associated with the exception becomes the action completion status.
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.
task - The task which received the messageexception - The exception which was thrown.
DramaException - Thrown on errors in the DRAMA code.
|
DJAVA | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tjf@aaoepp.aao.gov.au.