|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.sourceforge.esw.util.SupportObject
|
+--net.sourceforge.esw.service.DefaultHeartbeatGenerator
Describes the methods to generate and receive IHeartbeat instances from any application.
An IHeartbeatGenerator instance sends out an IHeartbeat instance at the
interval specified by the setInterval method. One can request a
current IHeartbeat instance at any time by asking for an IHeartbeat instance
from the getHeartbeat method.
Objects that would like to send Telemtry data along with an IHeartbeat
instance should register their intent to do so with the
addTelemetrySource method.
To register intent to monitor the heartbeat of this IHeartbeatGenerator
instance or to gain access to telemetry sent from this IHeartbeatGenerator
instance, use the addHeartbeatMonitor method.
IHeartbeat,
IService, Serialized Form| Field Summary | |
protected boolean |
bStarted
States whether this DefaultHeartbeatGenerator has started sending IHeartbeat instances. |
protected ListenerSupport |
heartbeatMonitors
The list of IHeartbeatMonitor instances to send IHeartbeat instances to. |
protected int |
interval
The time interval for collecting and generating IHeartbeats instances. |
protected ListenerSupport |
telemetrySource
The list of ITelemetrySource instances to get ITelemetry instances from. |
| Fields inherited from class net.sourceforge.esw.util.SupportObject |
id, properties, propertyChildren, propertyListeners, vetoableChildren, vetoableListeners |
| Constructor Summary | |
DefaultHeartbeatGenerator()
Creates a new instance of this DefaultHeartbeatGenerator. |
|
| Method Summary | |
void |
addHeartbeatMonitor(IHeartbeatMonitor aMonitor)
Adds a new IHeartbeatMonitor instance that is interested in receiving IHeartbeat instances from this IHeartbeatGenerator instance. |
void |
addTelemetrySource(ITelemetrySource aSource)
Adds a new ITelemetrySource instance to this IHeartbeatGenerator instance. |
IHeartbeat |
getHeartbeat()
Generates and returns a current IHeartbeat instance, This method is the pull part of the push/pull monitoring pattern. |
int |
getInterval()
Returns the interval for the sending of IHeartbeat instances to the IHeartbeatMonitor instances. |
boolean |
isStarted()
States whether this IHeartbeatGenerator instance is started. |
void |
removeHeartbeatMonitor(IHeartbeatMonitor aMonitor)
Removes a IHeartbeatMonitor instance from this IHeartbeatGenerator instance. |
void |
removeTelemetrySource(ITelemetrySource aSource)
Removes a ITelemetrySource instance from this IHeartbeatGenerator instance. |
void |
setInterval(int aTime)
Sets the interval for the sending of IHeartbeat instances to the IHeartbeatMonitor instances. |
void |
start()
Starts the process of generating IHeartbeat instances to each IHeartbeatMonitor instance registered with this IHeartbeatGenerator instance at the specified milliseond interval. |
void |
stop()
Stops the process of generating IHeartbeat instances to each IHeartbeatMonitor instance registered with this IHeartbeatGenerator instance at the specified milliseond interval. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sourceforge.esw.util.ISupportObject |
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getID, getProperty, getPropertySize, propertyKeys, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setID, setProperty |
| Field Detail |
protected int interval
protected boolean bStarted
protected ListenerSupport heartbeatMonitors
protected ListenerSupport telemetrySource
| Constructor Detail |
public DefaultHeartbeatGenerator()
| Method Detail |
public void setInterval(int aTime)
Fires an IServiceResources.INTERVAL_PROPERTY property change event.
setInterval in interface IHeartbeatGeneratoraTime - the amount of time in milliseconds for this
IHeartbeatGenerator instance to send IHeartbeat instances.getInterval()public int getInterval()
getInterval in interface IHeartbeatGeneratorsetInterval(int)public IHeartbeat getHeartbeat()
getHeartbeat in interface IHeartbeatGeneratorpublic void start()
Fires an IServiceResources.START_PROPERTY property change event.
start in interface IHeartbeatGeneratorstop(),
setInterval(int)public void stop()
Fires an IServiceResources.STOP_PROPERTY property change event.
stop in interface IHeartbeatGeneratorstart(),
setInterval(int)public boolean isStarted()
isStarted in interface IHeartbeatGeneratorpublic void addTelemetrySource(ITelemetrySource aSource)
The ITelemetrySource instance defines the ability for an object to send ITelemetry instances to registered IHeartbeatMonitor instances.
Fires an IServiceResources.TELEMETRY_SOURCE_PROPERTY property change event.
addTelemetrySource in interface IHeartbeatGeneratoraSource - the new ITelemetrySource instance to be added.removeTelemetrySource(ITelemetrySource)public void removeTelemetrySource(ITelemetrySource aSource)
Fires an IServiceResources.TELEMETRY_SOURCE_PROPERTY property change event.
removeTelemetrySource in interface IHeartbeatGeneratoraSource - the ITelemetrySource instance to be removed.addTelemetrySource(ITelemetrySource)public void addHeartbeatMonitor(IHeartbeatMonitor aMonitor)
The IHeartbeatMonitor instance defines the ability for an object to send ITelemetry instances to registered IHeartbeatMonitor instances.
Fires an IServiceResources.HEARTBEAT_MONITOR_PROPERTY property change event.
addHeartbeatMonitor in interface IHeartbeatGeneratoraMonitor - the new IHeartbeatMonitor instance to be added.removeHeartbeatMonitor(IHeartbeatMonitor)public void removeHeartbeatMonitor(IHeartbeatMonitor aMonitor)
Fires an IServiceResources.HEARTBEAT_MONITOR_PROPERTY property change event.
removeHeartbeatMonitor in interface IHeartbeatGeneratoraMonitor - the new IHeartbeatMonitor instance to be removed.addHeartbeatMonitor(IHeartbeatMonitor)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||