AP&C API Reference
Public Member Functions | Protected Member Functions | Properties | Events | List of all members
Apac.Supervisable Class Referenceabstract
Inheritance diagram for Apac.Supervisable:
Apac.ISupervisable Apac.Control.MockController Apac.Data.ThreadedCompilationEngine Apac.Data.ThreadedMeasurementStore Apac.Data.ThreadedPostProcessingEngine Apac.EventManagement.EventEngine Apac.LicensedSupervisable Apac.Management.OutboundPublicIpReport Apac.Reporting.GraphGenerator Apac.Reporting.ThreadedReportingEngine

Public Member Functions

void Initialize (Apac.Configuration.SupervisableConfig config, Supervisors.ISupervisor supervisor)
 Initializes the controller from configuration. More...
 
void ResolveReferences ()
 Resolves any references this component might hold to other supervisable components. More...
 
void CheckReferencesStates ()
 Checks the states of referenced components to be sure they are satisfactory for this component's operation. More...
 
void Starting ()
 Signals that the component will be starting on its own thread. This implementation uses this opportunity to CheckReferencesStates, change state to Starting, and signal subclasses with OnStarting. More...
 
void Start ()
 Starts the component. More...
 
void Stop ()
 Stops the component. More...
 
- Public Member Functions inherited from Apac.ISupervisable
void Initialize (Apac.Configuration.SupervisableConfig config, Supervisors.ISupervisor exec)
 Initializes the component with the given SupervisableConfig (or derivative) and ISupervisor. More...
 

Protected Member Functions

abstract void OnInitialize (Apac.Configuration.SupervisableConfig config)
 Called when the supervisable component is intitialized. More...
 
abstract void OnResolveReferences ()
 Called when the supervisable component needs to resolve its runtime references to other components. More...
 
abstract void OnCheckReferencesStates ()
 Called when the supervisable component needs to check the state of its runtime reference components. More...
 
virtual void OnStarting ()
 Called when the supervisable component is about to start. This differs from handling OnStart in that this method is called on the supervisor's thread, whereas Start is called on a new thread. Subclasses may override this to do work that is considered initialization work that should be done before all component threads are started. More...
 
abstract void OnStart ()
 Called to start the supervisable component. More...
 
abstract void OnStop ()
 Called to stop the supervisable component. More...
 
virtual void OnStateChanging (SupervisableState currentState, SupervisableState newState)
 Call chain for state changing notification. More...
 
virtual void OnStateChanged (SupervisableState previousState, SupervisableState newState)
 Call chain for state changed notification. More...
 
virtual void OnException (Exception ex)
 Call chain for exception notification. More...
 
void SetState (SupervisableState newState)
 Changes the state of the controller to the new state. More...
 
virtual void OnStateChangeStarting ()
 
virtual void OnStateChangeRunning ()
 
virtual void OnStateChangeStopping ()
 
virtual void OnStateChangeStopped ()
 
virtual void OnStateChangeInitializing ()
 
virtual void OnStateChangeInitialized ()
 
virtual void OnStateChangeErrored ()
 
virtual void OnStateChangeImpaired ()
 
void HandleException (string message, Exception e)
 Deals with the details of handling exceptions captured by the controller. More...
 
void ResetException ()
 Allows subclasses to reset the last exception to an empty state. More...
 
void HandleImpairment (string message, Exception e)
 Deals with the details of handling non-critical problems captured by the controller. More...
 

Properties

string Name [get]
 Gets the name of the controller, as specified by configuration. Note that if the name is not specified, then an index will be used. More...
 
string Description [get]
 Gets the description of the controller, as specified by configuration. More...
 
bool Prioritized [get]
 Indicates if the supervisable component should be executed on a higher thread priority. More...
 
DateTime LastHeartbeat [get]
 The time of the last heartbeat. More...
 
Supervisors.ISupervisor ExecutiveSupervisor [get]
 Walks the tree to find the top level supervisor. More...
 
bool IsRunning [get]
 Gets a value indicating whether this instance is running. More...
 
SupervisableState CurrentState [get]
 Gets the current overall state of the controller. More...
 
SupervisableState PreviousState [get]
 Gets the previous overall state of the controller. More...
 
Exception LastException [get]
 Gets the last exception encountered within the controller. More...
 
DateTime StartTime [get]
 Gets the time this supervisable component was started. More...
 
DateTime StopTime [get]
 Gets the time this supervisable component was stopped. More...
 
TimeSpan UpTime [get]
 Gets the amount of time this supervisable component has been running, or did run before it was stopped (if IsRunning is false). More...
 
Supervisors.ISupervisor Supervisor [get]
 Gets the supervisor. More...
 
SupervisableConfig Config [get]
 The configuration object used by the supervisable component. More...
 
log4net.ILog Log [get]
 Lazy-initialized logger for subclass usage. More...
 
- Properties inherited from Apac.ISupervisable
string Name [get]
 The name of the component, for unique identification purposes. More...
 
string Description [get]
 The description of the component, for human consumption. More...
 
bool Prioritized [get]
 Indicates if the component should be high priority. More...
 
Supervisors.ISupervisor ExecutiveSupervisor [get]
 Walks the tree to find the top level supervisor. More...
 
bool IsRunning [get]
 Indicates that the component is running. More...
 
DateTime LastHeartbeat [get]
 
DateTime StartTime [get]
 Gets the time this supervisable component was started. More...
 
DateTime StopTime [get]
 Gets the time this supervisable component was stopped. More...
 
TimeSpan UpTime [get]
 Gets the amount of time this supervisable component has been running, or did run before it was stopped (if IsRunning is false). More...
 
SupervisableState CurrentState [get]
 Gets the current SupervisableState of this component. More...
 
SupervisableState PreviousState [get]
 Gets the previous SupervisableState of this component. More...
 
Exception LastException [get]
 Gets the last exception to have occurred and been trapped by this component. More...
 

Events

SupervisableStateChangingHandler SupervisableStateChanging
 Notifies listeners that the state is about to change. More...
 
SupervisableStateChangedHandler SupervisableStateChanged
 Notifies listeners that the state has changed. More...
 
SupervisableErroredHandler SupervisableErrored
 Notifies listeners that an error occured within the controller. More...
 
SupervisableHeartbeatHandler SupervisableHeartbeat
 Notifies listeners that the component is still active. More...
 
- Events inherited from Apac.ISupervisable
SupervisableStateChangingHandler SupervisableStateChanging
 Notifies listeners that the state is about to change. More...
 
SupervisableStateChangedHandler SupervisableStateChanged
 Notifies listeners that the state has changed. More...
 
SupervisableErroredHandler SupervisableErrored
 Notifies listeners that an error occured within the controller. More...
 
SupervisableHeartbeatHandler SupervisableHeartbeat
 Notifies listeners that the component is still active. More...
 

Member Function Documentation

◆ CheckReferencesStates()

void Apac.Supervisable.CheckReferencesStates ( )
inline

Checks the states of referenced components to be sure they are satisfactory for this component's operation.

Implements Apac.ISupervisable.

◆ HandleException()

void Apac.Supervisable.HandleException ( string  message,
Exception  e 
)
inlineprotected

Deals with the details of handling exceptions captured by the controller.

Parameters
messageA specific message to be logged with the exception.
eThe exception being handled.

◆ HandleImpairment()

void Apac.Supervisable.HandleImpairment ( string  message,
Exception  e 
)
inlineprotected

Deals with the details of handling non-critical problems captured by the controller.

Parameters
messageA specific message to be logged.
eThe exception causing the impairment, if applicable. This parameter can be null.

◆ Initialize()

void Apac.Supervisable.Initialize ( Apac.Configuration.SupervisableConfig  config,
Supervisors.ISupervisor  supervisor 
)
inline

Initializes the controller from configuration.

Parameters
config

◆ OnCheckReferencesStates()

abstract void Apac.Supervisable.OnCheckReferencesStates ( )
protectedpure virtual

◆ OnException()

virtual void Apac.Supervisable.OnException ( Exception  ex)
inlineprotectedvirtual

Call chain for exception notification.

Parameters
exThe exception that is being notified.

◆ OnInitialize()

abstract void Apac.Supervisable.OnInitialize ( Apac.Configuration.SupervisableConfig  config)
protectedpure virtual

◆ OnResolveReferences()

abstract void Apac.Supervisable.OnResolveReferences ( )
protectedpure virtual

◆ OnStart()

abstract void Apac.Supervisable.OnStart ( )
protectedpure virtual

◆ OnStarting()

virtual void Apac.Supervisable.OnStarting ( )
inlineprotectedvirtual

Called when the supervisable component is about to start. This differs from handling OnStart in that this method is called on the supervisor's thread, whereas Start is called on a new thread. Subclasses may override this to do work that is considered initialization work that should be done before all component threads are started.

Reimplemented in Apac.PassiveHaus.DataManager, Apac.Ecop.DataManager, Apac.Control.MockController2, Apac.Dlp.Control.DlpIo20Controller, and Apac.Dallas.OneWire.Control.OneWireController.

◆ OnStateChanged()

virtual void Apac.Supervisable.OnStateChanged ( SupervisableState  previousState,
SupervisableState  newState 
)
inlineprotectedvirtual

Call chain for state changed notification.

Parameters
previousStateThe state from which the controller just changed.
newStateThe state to which the controller just changed.

◆ OnStateChanging()

virtual void Apac.Supervisable.OnStateChanging ( SupervisableState  currentState,
SupervisableState  newState 
)
inlineprotectedvirtual

Call chain for state changing notification.

Parameters
currentStateThe state from which the controller will transition.
newStateThe state to which the controller will transition.

◆ OnStop()

abstract void Apac.Supervisable.OnStop ( )
protectedpure virtual

◆ ResetException()

void Apac.Supervisable.ResetException ( )
inlineprotected

Allows subclasses to reset the last exception to an empty state.

◆ ResolveReferences()

void Apac.Supervisable.ResolveReferences ( )
inline

Resolves any references this component might hold to other supervisable components.

Implements Apac.ISupervisable.

◆ SetState()

void Apac.Supervisable.SetState ( SupervisableState  newState)
inlineprotected

Changes the state of the controller to the new state.

Parameters
newStateThe new state for the controller.

This method will not notify or make changes if the new state is not different from the current state.

◆ Start()

void Apac.Supervisable.Start ( )
inline

Starts the component.

Implements Apac.ISupervisable.

◆ Starting()

void Apac.Supervisable.Starting ( )
inline

Signals that the component will be starting on its own thread. This implementation uses this opportunity to CheckReferencesStates, change state to Starting, and signal subclasses with OnStarting.

Implements Apac.ISupervisable.

◆ Stop()

void Apac.Supervisable.Stop ( )
inline

Stops the component.

Implements Apac.ISupervisable.

Property Documentation

◆ Config

SupervisableConfig Apac.Supervisable.Config
getprotected

The configuration object used by the supervisable component.

◆ CurrentState

SupervisableState Apac.Supervisable.CurrentState
get

Gets the current overall state of the controller.

◆ Description

string Apac.Supervisable.Description
get

Gets the description of the controller, as specified by configuration.

◆ ExecutiveSupervisor

Supervisors.ISupervisor Apac.Supervisable.ExecutiveSupervisor
get

Walks the tree to find the top level supervisor.

Returns

◆ IsRunning

bool Apac.Supervisable.IsRunning
get

Gets a value indicating whether this instance is running.

true if this instance is running; otherwise, false.

◆ LastException

Exception Apac.Supervisable.LastException
get

Gets the last exception encountered within the controller.

◆ LastHeartbeat

DateTime Apac.Supervisable.LastHeartbeat
get

The time of the last heartbeat.

◆ Log

log4net.ILog Apac.Supervisable.Log
getprotected

Lazy-initialized logger for subclass usage.

◆ Name

string Apac.Supervisable.Name
get

Gets the name of the controller, as specified by configuration. Note that if the name is not specified, then an index will be used.

◆ PreviousState

SupervisableState Apac.Supervisable.PreviousState
get

Gets the previous overall state of the controller.

◆ Prioritized

bool Apac.Supervisable.Prioritized
get

Indicates if the supervisable component should be executed on a higher thread priority.

◆ StartTime

DateTime Apac.Supervisable.StartTime
get

Gets the time this supervisable component was started.

◆ StopTime

DateTime Apac.Supervisable.StopTime
get

Gets the time this supervisable component was stopped.

◆ Supervisor

Supervisors.ISupervisor Apac.Supervisable.Supervisor
getprotected

Gets the supervisor.

◆ UpTime

TimeSpan Apac.Supervisable.UpTime
get

Gets the amount of time this supervisable component has been running, or did run before it was stopped (if IsRunning is false).

Event Documentation

◆ SupervisableErrored

SupervisableErroredHandler Apac.Supervisable.SupervisableErrored

Notifies listeners that an error occured within the controller.

◆ SupervisableHeartbeat

SupervisableHeartbeatHandler Apac.Supervisable.SupervisableHeartbeat

Notifies listeners that the component is still active.

◆ SupervisableStateChanged

SupervisableStateChangedHandler Apac.Supervisable.SupervisableStateChanged

Notifies listeners that the state has changed.

◆ SupervisableStateChanging

SupervisableStateChangingHandler Apac.Supervisable.SupervisableStateChanging

Notifies listeners that the state is about to change.


The documentation for this class was generated from the following file: