net.sourceforge.esw.service
Interface IHeartbeatGenerator

All Superinterfaces:
ISupportObject, java.io.Serializable
All Known Implementing Classes:
DefaultHeartbeatGenerator

public interface IHeartbeatGenerator
extends ISupportObject

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.

See Also:
IHeartbeat, IService

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 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
 

Method Detail

setInterval

public void setInterval(int aTime)
Sets the interval for the sending of IHeartbeat instances to the IHeartbeatMonitor instances. This interval is in milliseconds. This IHeartbeatGenerator instance must be started before it sends any IHeartbeat instances.

Fires an IServiceResources.INTERVAL_PROPERTY property change event.

Parameters:
aTime - the amount of time in milliseconds for this IHeartbeatGenerator instance to send IHeartbeat instances.
See Also:
getInterval()

getInterval

public int getInterval()
Returns the interval for the sending of IHeartbeat instances to the IHeartbeatMonitor instances. This interval is in milliseconds. This IHeartbeatGenerator instance must be started before it sends any IHeartbeat instances.

Returns:
the amount of time in milliseconds for this IHeartbeatGenerator instance to send IHeartbeat instances.
See Also:
setInterval(int)

getHeartbeat

public IHeartbeat getHeartbeat()
Generates and returns a current IHeartbeat instance, This method is the pull part of the push/pull monitoring pattern.

Returns:
a newly generated IHeartbeat instance from the ITelemetrySource instances.

start

public void start()
Starts the process of generating IHeartbeat instances to each IHeartbeatMonitor instance registered with this IHeartbeatGenerator instance at the specified milliseond interval.

Fires an IServiceResources.START_PROPERTY property change event.

See Also:
stop(), setInterval(int)

stop

public void stop()
Stops the process of generating IHeartbeat instances to each IHeartbeatMonitor instance registered with this IHeartbeatGenerator instance at the specified milliseond interval.

Fires an IServiceResources.STOP_PROPERTY property change event.

See Also:
start(), setInterval(int)

isStarted

public boolean isStarted()
States whether this IHeartbeatGenerator instance is started.

Returns:
whether this IHeartbeatGenerator instance is started.

addTelemetrySource

public void addTelemetrySource(ITelemetrySource aSource)
Adds a new ITelemetrySource instance to this IHeartbeatGenerator instance.

The ITelemetrySource instance defines the ability for an object to send ITelemetry instances to registered IHeartbeatMonitor instances.

Parameters:
aSource - the new ITelemetrySource instance to be added.
See Also:
removeTelemetrySource(ITelemetrySource)

removeTelemetrySource

public void removeTelemetrySource(ITelemetrySource aSource)
Removes a ITelemetrySource instance from this IHeartbeatGenerator instance.

Parameters:
aSource - the ITelemetrySource instance to be removed.
See Also:
addTelemetrySource(ITelemetrySource)

addHeartbeatMonitor

public void addHeartbeatMonitor(IHeartbeatMonitor aMonitor)
Adds a new IHeartbeatMonitor instance that is interested in receiving IHeartbeat instances from this IHeartbeatGenerator instance.

The IHeartbeatMonitor instance defines the ability for an object to send ITelemetry instances to registered IHeartbeatMonitor instances.

Parameters:
aMonitor - the new IHeartbeatMonitor instance to be added.
See Also:
removeHeartbeatMonitor(IHeartbeatMonitor)

removeHeartbeatMonitor

public void removeHeartbeatMonitor(IHeartbeatMonitor aMonitor)
Removes a IHeartbeatMonitor instance from this IHeartbeatGenerator instance.

Parameters:
aMonitor - the new IHeartbeatMonitor instance to be removed.
See Also:
addHeartbeatMonitor(IHeartbeatMonitor)


Copyright 2002 Free Software Foundation. All Rights Reserved.