INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
gbxutilacfr::Status Class Referenceabstract Local interface to component status. More...
Inheritance diagram for gbxutilacfr::Status:
![]()
Detailed DescriptionLocal interface to component status.
Status provides a machine-readable interface such that tools external to the component can monitor its status. A single Status object is meant to be shared by all threads in the library, so the implementation must be thread-safe. The idea is that Status tracks the state of a number of subsystems (most often one per thread). Each subsystem should first call addSubsystem(), to make the Status engine aware that it exists. If any other function is called before the subsystem is added, a gbxutilacfr::Exception is thrown. The default initial status of a subsystem is After registering a subsystem, a subsystem can report its state and health. Each of the calls is sufficient to let the Status engine know that the subsystem is alive. The special call heartbeat() lets Status know that the subsystem is alive without modifying its status. The 'maxHeartbeatIntervalSec' parameter tells the Status engine how often it should expect to hear from the subsystem. If no message is received from a subsystem for longer than
The state machine of a subsystem is a chain of state transitions with one extra link: Idle --> Initialising --> Working --> Finalising --> Shutdown |___________________________^ In addition, the system can transition to Fault state from any other state. The following represents the Subsystem state machine in the format of State Machine Compiler (see smc.sf.net) : Idle Entry { init(); } { init Initialising {} } Initialising Entry { initialise(); } { [ !isStopping ] finished Working {} [ isStopping ] finished Finalising {} } Working Entry { work(); } { finished Finalising {} } Finalising Entry { finalise(); } { finished Shutdown {} } Shutdown { } Fault { } Default { fault Fault {} } Member Function Documentation◆ addSubsystem()
Adds a new subsystem to the system status descriptor. This command must be called before actually modifying the subsystem status, i.e. all other status commands will raise an exception if a subsystem with that name does not already exists. An Exception is also raised when trying to add a subsystem with an existing name. It is possible to specify the maximum expected interval between heartbeats. See setMaxHeartbeatInterval() for details. It is also possible to describe the expected behavior of the subsystem by specifying SubsystemType. See setSubsystemType() for details. The initial status of the new subsystem is the same as produced by the empty constructor of SubsystemStatus. Implemented in gbxutilacfr::TrivialStatus. ◆ componentStatus()
Returns state of the component infrastructure. Returns component status. Component status cannot be set directly, it is the aggregate of the states and healths of its subsystems and the infrastructure. Implemented in gbxutilacfr::TrivialStatus. ◆ critical()
Sets subsystem health to Critical. Diagnostic message is required. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ fault()
Sets state of the subsystem to Fault. Diagnostic message is required. Subsystem health is automatically changed to Critical. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ finalising()
Sets state of the subsystem to Finalising. Health and message are not affected. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ heartbeat()
Record heartbeat from a subsystem: let Status know the subsystem is alive without modifying its status. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ initialising()
Sets state of the subsystem to Initialising. Health and message are not affected. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ message()
Change the human-readable message for a subsystem but keep the previous state and health information. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ ok()
Sets subsystem health to Ok. The old message is cleared if a new one is not supplied. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ process()
This function must be called periodically in order for status publishing to happen and stalled susbsystems identified. Implemented in gbxutilacfr::TrivialStatus. ◆ removeSubsystem()
Removes a subsystem from the status descriptor. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ setMaxHeartbeatInterval()
Sets the maximum expected interval between heartbeats (in seconds). When time since the last heartbeat exceeds the specified value, the subsystem is considered stalled. Negative interval means infinite interval. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ setSubsystemStatus()
Sets the status of a subsystem (both state and health) in an atomic operation. Use this method when both state and health have changed. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ subsystemStatus()
Returns status of the subsystem with the given name. Throws Exception when the specified subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ warning()
Sets subsystem health to Warning. Diagnostic message is required. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. ◆ working()
Sets state of the subsystem to Working. Health and message are not affected. Throws Exception if the subsystem does not exist. Implemented in gbxutilacfr::TrivialStatus. The documentation for this class was generated from the following file: |