ParameterNoticeBoard
Class NoticeboardEvent

java.lang.Object
  extended by ParameterNoticeBoard.NoticeboardEvent

 class NoticeboardEvent
extends java.lang.Object

The NoticeboardEvent class is used by the event queue to store the details of queued events. Associated with each event is a delay which is the amount of time the event will be held in the queue before it is broadcast to any subscribed listeners. There is potentially a event queue for each parameter in the noticeboard but each queue is only one event long so only the last event recieved is stored. After the queue delay has expired then the event in the queue will be broadcast to the listeners.

Version:
$Id: NoticeboardEvent.java,v 1.2 2006/08/23 08:57:09 cb Exp $
Author:
Craige

Field Summary
private  long DelayBeforeBroadcasting
          This is the time in milliseconds that we have to delay before broadcasting this event.
 org.omg.CORBA.Any EventValue
          This is the CORBA value which is associated with the event
private  long QueueEntryTime
          This is the system time when the entry was queued.
 
Constructor Summary
NoticeboardEvent()
          Constructor for the class
NoticeboardEvent(org.omg.CORBA.Any EventValue)
          Constructor for the class
NoticeboardEvent(org.omg.CORBA.Any EventValue, long DelayBeforeBroadcasting)
          Constructor for the class
 
Method Summary
 void delayTransmissionOfNextEvent()
          Resets the time the event which was entered into the queue to the current time.
 boolean readyToBroadcast()
          Reports whether the event has been in the queue long enough now to be broadcast to the listeners.
 void updateQueuedEvent(org.omg.CORBA.Any EventValue)
          Update the queue event to the new event value thus flushing out the old event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EventValue

public org.omg.CORBA.Any EventValue
This is the CORBA value which is associated with the event


DelayBeforeBroadcasting

private long DelayBeforeBroadcasting
This is the time in milliseconds that we have to delay before broadcasting this event. By default we buffer up transmissions up to 500 ms.


QueueEntryTime

private long QueueEntryTime
This is the system time when the entry was queued.

Constructor Detail

NoticeboardEvent

NoticeboardEvent(org.omg.CORBA.Any EventValue,
                 long DelayBeforeBroadcasting)
Constructor for the class

Parameters:
EventValue - This is the value which is associated with the event.
DelayBeforeBroadcasting - This the amount of time expressed in milliseconds before the event will be transmitted to the listeners.

NoticeboardEvent

NoticeboardEvent(org.omg.CORBA.Any EventValue)
Constructor for the class

Parameters:
EventValue - This is the value which is associated with the event and is to be queued.

NoticeboardEvent

NoticeboardEvent()
Constructor for the class

Method Detail

readyToBroadcast

public boolean readyToBroadcast()
Reports whether the event has been in the queue long enough now to be broadcast to the listeners.

Returns:
boolean True if ready to broadcast event.

delayTransmissionOfNextEvent

public void delayTransmissionOfNextEvent()
Resets the time the event which was entered into the queue to the current time.


updateQueuedEvent

public void updateQueuedEvent(org.omg.CORBA.Any EventValue)
Update the queue event to the new event value thus flushing out the old event. This ensures that during the delay window associated with the queue we only broadcast the last event.

Parameters:
EventValue - This is the value which is associated with the event and is to be queued.