FourMS
Class FourMSCommsMonitor

java.lang.Object
  extended by java.util.TimerTask
      extended by FourMS.FourMSCommsMonitor
All Implemented Interfaces:
java.lang.Runnable

 class FourMSCommsMonitor
extends java.util.TimerTask

This class will monitor the time of the last communications from the 4MS module and should no comms be received from the module in the allocated time, the class will bring this to the attention of the system by creating an entry in the syslog and also setting a noticeboard item.

Version:
$Id: FourMSCommsMonitor.java,v 1.3 2006/04/07 08:05:39 cb Exp $
Author:
Craige Bevil

Field Summary
private  java.util.Timer CommsCheckTimer
          This is a timer object which will be used for scheduling the checking of the comms status
private  long CommsTimeoutPeriod
          The timeout period expressed in seconds after which the 4MS module is deemed to have timed out
private  boolean FirstCommsCheck
          Set to true if this is the first time that we have checked the comms of the 4MS
private  MessageListener FourMSMessageListener
          This is the object which is listening to the 4MS module and keeps a track of the time of the last communications with the 4MS module
private  boolean NoCommsReported
          A flag which records the fact that we have reported that has been a change in the state of the timeout
private  org.omg.CORBA.ORB Orb
          A reference to an ORB
private  iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
          This is reference to the remote proxy CORBA object which will be used to access the parameter noticeboard
private  MessageHandler SyslogMessageHandler
          This is a syslog object which will be used to report errors etc
private  java.lang.String TimeOutNBItem
          This is the noticeboard item which will be updated when there is a change in the communication state with the 4MS
 
Constructor Summary
FourMSCommsMonitor(MessageHandler SyslogMessageHandler, MessageListener FourMSMessageListener, java.lang.String TimeOutNBItem, iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard, long CommsTimeoutPeriod, org.omg.CORBA.ORB Orb)
          Constructor
 
Method Summary
 void run()
          Obligation of the TimerTask interface and is used to intermittingly check the 4MS message listener to see if we the 4MS has communicated with us in the last timeout period and if not then we create an alarm in the syslog and set a parameter noticeboard item
private  void updateCommsStatusInNoticeBoard(boolean CommsOK)
          This method will be used to update the noticeboard item which contains the state of the comms of the 4MS.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FirstCommsCheck

private boolean FirstCommsCheck
Set to true if this is the first time that we have checked the comms of the 4MS


NoCommsReported

private boolean NoCommsReported
A flag which records the fact that we have reported that has been a change in the state of the timeout


CommsCheckTimer

private final java.util.Timer CommsCheckTimer
This is a timer object which will be used for scheduling the checking of the comms status


SyslogMessageHandler

private MessageHandler SyslogMessageHandler
This is a syslog object which will be used to report errors etc


FourMSMessageListener

private MessageListener FourMSMessageListener
This is the object which is listening to the 4MS module and keeps a track of the time of the last communications with the 4MS module


ParameterNoticeBoard

private iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
This is reference to the remote proxy CORBA object which will be used to access the parameter noticeboard


TimeOutNBItem

private java.lang.String TimeOutNBItem
This is the noticeboard item which will be updated when there is a change in the communication state with the 4MS


CommsTimeoutPeriod

private long CommsTimeoutPeriod
The timeout period expressed in seconds after which the 4MS module is deemed to have timed out


Orb

private org.omg.CORBA.ORB Orb
A reference to an ORB

Constructor Detail

FourMSCommsMonitor

FourMSCommsMonitor(MessageHandler SyslogMessageHandler,
                   MessageListener FourMSMessageListener,
                   java.lang.String TimeOutNBItem,
                   iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard,
                   long CommsTimeoutPeriod,
                   org.omg.CORBA.ORB Orb)
Constructor

Parameters:
SyslogMessageHandler - Used to report messages to the syslog.
FourMSMessageListener - A reference to the object which is listening to the 4MS module.
TimeOutNBItem - The noticeboard item into which we have to write the state of the comms.
ParameterNoticeBoard - A reference to the noticeboard.
CommsTimeoutPeriod - The period expressed in seconds after which the comms is deemed to have failed.
Orb - An ORBD which will be used for various CORBA related duties.
Method Detail

updateCommsStatusInNoticeBoard

private void updateCommsStatusInNoticeBoard(boolean CommsOK)
This method will be used to update the noticeboard item which contains the state of the comms of the 4MS.

Parameters:
CommsOK - Whether the state of the communications is good.

run

public void run()
Obligation of the TimerTask interface and is used to intermittingly check the 4MS message listener to see if we the 4MS has communicated with us in the last timeout period and if not then we create an alarm in the syslog and set a parameter noticeboard item

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask