AP&C API Reference
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Apac.Data.ThreadedPostProcessingEngine Class Referenceabstract

Provides the core features for post-processing measurements and averages that pass through a compiler. This is implemented by listening for compiler events and queueing work when they fire. More...

Inheritance diagram for Apac.Data.ThreadedPostProcessingEngine:
Apac.Supervisable Apac.Data.IDataAnalyzer Apac.ISupervisable Apac.Data.AlertingPostProcessor Apac.Data.ChainedMeasurementAnalyzer

Public Member Functions

 ThreadedPostProcessingEngine ()
 Initializes a new instance of the ThreadedPostProcessingEngine class. More...
 
 ThreadedPostProcessingEngine (IMeasurementStore dataStore, ISettingsStore settingStore, IDataCompiler compiler, IEventProcessor evtProc)
 Initializes a new instance of the ThreadedPostProcessingEngine class. More...
 
void AnalyzeMeasurements (Measurements measurements)
 Analyzes the measurements. More...
 
- Public Member Functions inherited from Apac.Supervisable
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...
 
- Public Member Functions inherited from Apac.Data.IDataAnalyzer
void AnalyzeMeasurements (Monitoring.Measurements measurements)
 

Protected Member Functions

override void OnInitialize (Apac.Configuration.SupervisableConfig config)
 Called when the supervisable component is intitialized. More...
 
override void OnStart ()
 Called to start the supervisable component. More...
 
override void OnStop ()
 Called to stop the supervisable component. More...
 
override void OnResolveReferences ()
 Called when the supervisable component needs to resolve its runtime references to other components. More...
 
override void OnCheckReferencesStates ()
 Called when the supervisable component needs to check the state of its runtime reference components. More...
 
abstract void OnPostProcessMeasurements (Measurements measurements)
 Signals when measurements are being post-processed. More...
 
abstract void OnPostProcessFiveMinAvgs (ITimeStamped data)
 Signals when five minute averages are being post-processed. More...
 
abstract void OnPostProcessHourlyAvgs (ITimeStamped data)
 Signals when hourly averages are being post-processed. More...
 
abstract void OnPostProcessDailyAvgs (ITimeStamped data)
 Signals when daily averages are being post-processed. More...
 
abstract void OnPostProcessMonthlyAvgs (ITimeStamped data)
 Signals when monthly averages are being post-processed. More...
 
- Protected Member Functions inherited from Apac.Supervisable
abstract void OnInitialize (Apac.Configuration.SupervisableConfig config)
 Called when the supervisable component is intitialized. 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...
 
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...
 

Protected Attributes

volatile Configuration.PostProcessorConfig _config = null
 The configuration used to control this supevisable component's behavior. More...
 

Properties

IMeasurementStore Store [get]
 Provide subclasses with access to the store. More...
 
ISettingsStore SettingStore [get]
 Provide subclasses with access to the settings. More...
 
IEventProcessor EventProcessor [get]
 Provide subclasses with access to the event processor. More...
 
- Properties inherited from Apac.Supervisable
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...
 

Additional Inherited Members

- Events inherited from Apac.Supervisable
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...
 

Detailed Description

Provides the core features for post-processing measurements and averages that pass through a compiler. This is implemented by listening for compiler events and queueing work when they fire.

Template Parameters
ValueTypeThe type of data being processed.

Constructor & Destructor Documentation

◆ ThreadedPostProcessingEngine() [1/2]

Apac.Data.ThreadedPostProcessingEngine.ThreadedPostProcessingEngine ( )
inline

Initializes a new instance of the ThreadedPostProcessingEngine class.

◆ ThreadedPostProcessingEngine() [2/2]

Apac.Data.ThreadedPostProcessingEngine.ThreadedPostProcessingEngine ( IMeasurementStore  dataStore,
ISettingsStore  settingStore,
IDataCompiler  compiler,
IEventProcessor  evtProc 
)
inline

Initializes a new instance of the ThreadedPostProcessingEngine class.

Parameters
dataStoreThe data store.
settingStoreThe setting store.
compilerThe compiler.
evtProcThe event processor.

Member Function Documentation

◆ AnalyzeMeasurements()

void Apac.Data.ThreadedPostProcessingEngine.AnalyzeMeasurements ( Measurements  measurements)
inline

Analyzes the measurements.

Parameters
measurementsThe measurements.

◆ OnCheckReferencesStates()

override void Apac.Data.ThreadedPostProcessingEngine.OnCheckReferencesStates ( )
inlineprotectedvirtual

Called when the supervisable component needs to check the state of its runtime reference components.

Implements Apac.Supervisable.

◆ OnInitialize()

override void Apac.Data.ThreadedPostProcessingEngine.OnInitialize ( Apac.Configuration.SupervisableConfig  config)
inlineprotected

Called when the supervisable component is intitialized.

Parameters
configThe configuration to use for initialization.

◆ OnPostProcessDailyAvgs()

abstract void Apac.Data.ThreadedPostProcessingEngine.OnPostProcessDailyAvgs ( ITimeStamped  data)
protectedpure virtual

Signals when daily averages are being post-processed.

Parameters
dataThe data.

Implemented in Apac.Data.ChainedMeasurementAnalyzer.

◆ OnPostProcessFiveMinAvgs()

abstract void Apac.Data.ThreadedPostProcessingEngine.OnPostProcessFiveMinAvgs ( ITimeStamped  data)
protectedpure virtual

Signals when five minute averages are being post-processed.

Parameters
dataThe data.

Implemented in Apac.Data.ChainedMeasurementAnalyzer.

◆ OnPostProcessHourlyAvgs()

abstract void Apac.Data.ThreadedPostProcessingEngine.OnPostProcessHourlyAvgs ( ITimeStamped  data)
protectedpure virtual

Signals when hourly averages are being post-processed.

Parameters
dataThe data.

Implemented in Apac.Data.ChainedMeasurementAnalyzer.

◆ OnPostProcessMeasurements()

abstract void Apac.Data.ThreadedPostProcessingEngine.OnPostProcessMeasurements ( Measurements  measurements)
protectedpure virtual

Signals when measurements are being post-processed.

Parameters
measurementsThe measurements.

Implemented in Apac.Data.ChainedMeasurementAnalyzer.

◆ OnPostProcessMonthlyAvgs()

abstract void Apac.Data.ThreadedPostProcessingEngine.OnPostProcessMonthlyAvgs ( ITimeStamped  data)
protectedpure virtual

Signals when monthly averages are being post-processed.

Parameters
dataThe data.

Implemented in Apac.Data.ChainedMeasurementAnalyzer.

◆ OnResolveReferences()

override void Apac.Data.ThreadedPostProcessingEngine.OnResolveReferences ( )
inlineprotectedvirtual

Called when the supervisable component needs to resolve its runtime references to other components.

Implements Apac.Supervisable.

◆ OnStart()

override void Apac.Data.ThreadedPostProcessingEngine.OnStart ( )
inlineprotectedvirtual

Called to start the supervisable component.

Implements Apac.Supervisable.

◆ OnStop()

override void Apac.Data.ThreadedPostProcessingEngine.OnStop ( )
inlineprotectedvirtual

Called to stop the supervisable component.

Implements Apac.Supervisable.

Member Data Documentation

◆ _config

volatile Configuration.PostProcessorConfig Apac.Data.ThreadedPostProcessingEngine._config = null
protected

The configuration used to control this supevisable component's behavior.

Property Documentation

◆ EventProcessor

IEventProcessor Apac.Data.ThreadedPostProcessingEngine.EventProcessor
getprotected

Provide subclasses with access to the event processor.

◆ SettingStore

ISettingsStore Apac.Data.ThreadedPostProcessingEngine.SettingStore
getprotected

Provide subclasses with access to the settings.

◆ Store

IMeasurementStore Apac.Data.ThreadedPostProcessingEngine.Store
getprotected

Provide subclasses with access to the store.


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