stella.telescope
Class OpenPilarSocket.Monitor

java.lang.Object
  extended by stella.telescope.OpenPilarSocket.Monitor
Enclosing class:
OpenPilarSocket

private class OpenPilarSocket.Monitor
extends Object

A class that takes a list of commands and checks incoming state changes if all of the monitored commands are completed/acknowledged.


Field Summary
private  Object acknowledge
          The lock object for waits on acknowledge.
private  Collection commands
          The list of commands monitored.
private  Object complete
          The lock object for complete waits.
 
Constructor Summary
protected OpenPilarSocket.Monitor(Collection watch)
           
 
Method Summary
protected  boolean allAcknowledged()
          Checks, if all monitored commands have been acknowledged.
protected  boolean allCompleted()
          Checks, if all monitored commands have been completed.
private  void checkState(TplCommand ready)
          Checks, if the incoming class is watched by this monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commands

private Collection commands
The list of commands monitored.


acknowledge

private Object acknowledge
The lock object for waits on acknowledge.


complete

private Object complete
The lock object for complete waits.

Constructor Detail

OpenPilarSocket.Monitor

protected OpenPilarSocket.Monitor(Collection watch)
Method Detail

checkState

private void checkState(TplCommand ready)
Checks, if the incoming class is watched by this monitor. If so, we further check if all commands are now completed/acknowledged. In this case, we notify waiting objects on this completeness.


allAcknowledged

protected boolean allAcknowledged()
Checks, if all monitored commands have been acknowledged.


allCompleted

protected boolean allCompleted()
Checks, if all monitored commands have been completed.