HbEngine

org.eso.ias.heartbeat.HbEngine
See theHbEngine companion object
class HbEngine extends Runnable

The HbEngine periodically sends the message to the publisher subscriber framework.

Users of this class shall only notify of changes in the status message.

It is a singleton to be sure that the same tool does not send the HB twice.

The initial status is STARTING_UP; then it must be updated by calling updateHbState to follow the computational phases of the tool that sends the HB.

Value parameters

frequency

the frequency to send the heartbeat (seconds)

hb

the heartbeat of the tool

publisher

publish HB messages

Attributes

Companion
object
Graph
Supertypes
trait Runnable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addProperty(key: String, value: String): Option[String]

Add a property to attach to the HB message

Add a property to attach to the HB message

Value parameters

key

the key of the property

value

he value of the property

Attributes

Returns

the previous value of the key; empty if a value with the given key does not exist

def clearProps(): Unit

Remove all the properties from the map

Remove all the properties from the map

Attributes

def getActualStatus: HeartbeatStatus

Return the actual status message

Return the actual status message

It is empty if the engine has not yet been initialized

Attributes

def isClosed: Boolean

Attributes

Returns

true if the HB has been closed; false otherwise

def isStarted: Boolean

Attributes

Returns

true if the HB has been started; false otherwise

def removeProperty(key: String): Option[String]

Remove a the property with the given key, if it exists

Remove a the property with the given key, if it exists

Value parameters

key

the key of the property to remove

Attributes

Returns

the value previously associated with the given key, if it exists

override def run(): Unit

Sends the heartbeat to the publisher

Sends the heartbeat to the publisher

Attributes

Definition Classes
Runnable
def shutdown(): Unit

Stops sending the heartbeat and free the resources

Stops sending the heartbeat and free the resources

Attributes

def start(): Unit

Start periodic sending of the heartbeat with the default initial status

Start periodic sending of the heartbeat with the default initial status

Attributes

def start(hbState: HeartbeatStatus): Unit

Start periodic sending of the heartbeat with the given initial status

Start periodic sending of the heartbeat with the given initial status

Value parameters

hbState

The initial state of the process

Attributes

def updateHbState(newStateMsg: HeartbeatStatus): Unit

Update the Hb status message

Update the Hb status message

Value parameters

newStateMsg

The new state

Attributes

Concrete fields

val frequency: Long
val hb: Heartbeat
val initialStatusDefault: HeartbeatStatus

The intial status set by default. Can be overridden with HbEngine.start

The intial status set by default. Can be overridden with HbEngine.start

Attributes

val shutDownThread: Thread

Shutdown hook

Shutdown hook

Attributes