DJAVA

au.gov.aao.drama
Class DramaMonitor.MonResponse

java.lang.Object
  extended by au.gov.aao.drama.DramaMonitor.MonResponse
Enclosing class:
DramaMonitor

public static class DramaMonitor.MonResponse
extends Object

Used to handle DramaMonitor responses.

An object of this type is used to handle messages returned in response to a Monitor transaction. Users of the class can override the SucessCompletion(), ErrorCompletion(), Started() or Changed() method in order to intercept these messages and implemented the user's perfered functionally.


Constructor Summary
DramaMonitor.MonResponse()
          Initialise a Monitor Response object.
 
Method Summary
 void Changed(DramaMonitor monitor, DramaTask task, String name, Arg value)
          Handle the parameter changed monitor message.
 boolean ErrorCompletion(DramaMonitor monitor, DramaTask task)
          Handle the completion with an error of a monitor transaction.
 void Started(DramaMonitor monitor, DramaTask task)
          Handle the monitor started message.
 boolean SuccessCompletion(DramaMonitor monitor, DramaTask task)
          Handle the sucessfull completion of a monitor transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DramaMonitor.MonResponse

public DramaMonitor.MonResponse()
Initialise a Monitor Response object.

Method Detail

SuccessCompletion

public boolean SuccessCompletion(DramaMonitor monitor,
                                 DramaTask task)
                          throws DramaException
Handle the sucessfull completion of a monitor transaction. This will be invoked if a monitor transaction completes without error.

The behvaiour of the default implementation is to simply return false.

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:
monitor - The monitor object involved
task - The DRAMA task object involved.
Returns:
True if you have started another message or false if not.
Throws:
DramaException - Thrown on errors in the DRAMA code.

ErrorCompletion

public boolean ErrorCompletion(DramaMonitor monitor,
                               DramaTask task)
                        throws DramaException
Handle the completion with an error of a monitor transaction. This will be invoked if a monitor transaction completes with error.

The behvaiour of the default implementation is to return false after reporting an error.

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:
monitor - The monitor object involved
task - The DRAMA task object involved.
Returns:
True if you have started another message or false if not.
Throws:
DramaException - Thrown on errors in the DRAMA code.

Started

public void Started(DramaMonitor monitor,
                    DramaTask task)
             throws DramaException
Handle the monitor started message.

This method wil be invoked when the task receives the message indicating a monitor has been sucessfully started. It will then be possible to use the Monitor's Add(), Cancel() and Delete() methods. Additionally, the Changed() may now be invoked due to parameter value changes.

The behvaiour of the default implementation is to do nothing.

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:
monitor - The monitor object involved
task - The DRAMA task object involved.
Throws:
DramaException - Thrown on errors in the DRAMA code.

Changed

public void Changed(DramaMonitor monitor,
                    DramaTask task,
                    String name,
                    Arg value)
             throws DramaException
Handle the parameter changed monitor message.

This methhod will be invoked when the task receives a message indicating the value of a monitored parameter has changed.

The behaviour of the default implementation is to do nothing.

Node 1: When this method returns, the underlying SDS ID referred to by value becomes invalid and may be reassigned. You must not keep references to "value" after Changed() has returned, instead, if you wish to keep it about, create a deep copy of the item.

Note 2 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:
monitor - The monitor object involved
task - The DRAMA task object involved.
name - The name of the parameter the value of which has changed.
value - The SDS id (As an Arg item) of the parameter value.
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.