AP&C API Reference
|
The base implementation for ISupervisor providing controls for initializing, starting, and stopping configured ISupervisable instances. More...
Classes | |
class | SubordinateHandle |
This class is used during asynchronous invocation to keep a handle on the subordinate along with the method that was invoked (the function). More... | |
Public Member Functions | |
Licensing.AcquisitionResponse | RequestLocks (Licensing.LicensedFeatures features) |
This default implementation will return null . More... | |
Licensing.ReleaseResponse | ReleaseLock (string acquisitionId) |
void | Initialize (SupervisableConfig config, ISupervisor exec) |
Do basic initialization of simple supervisable configuraiton. More... | |
void | ResolveReferences () |
Prompts subordinates to resolve their references (supervisors don't have references). More... | |
void | CheckReferencesStates () |
Prompts the subordinates to check their references' states (supervisors don't have references). More... | |
void | Initialize (ConfigElement config) |
Initialized the supervisor from configuration. More... | |
ISupervisable | LocateSupervisableAgent (string name) |
Initiates the call chain to locate the supervisable agent with the given name. More... | |
ISupervisable[] | LocateSupervisableAgents (Predicate< ISupervisable > predicate, bool askExec) |
Initiates the call chain to locate the supervisable agent with the given name. More... | |
void | Starting () |
Signals that Start() will soon be called on the component. This can be used as an opportunity to perform preparatory activity, like checking the state of referenced components and similar actions. More... | |
void | Start () |
Instructs the supervisor to start operations. This call results in a No-Op if the supervisor is not in a Stopped or Initialized state. More... | |
void | Stop () |
Instructs the supervisor to stop operations. This call results in a No-Op if the supervisor is not running. More... | |
void | AddSubordinate (ISupervisable subordinate) |
Adds a subordinate under the control of the supervisor. More... | |
void | RemoveSubordinate (string name) |
Removes the subordinate with the given name; More... | |
void | StartSubordinate (string name) |
Starts the subordinate with the given name; More... | |
void | StopSubordinate (string name) |
Stops the subordinate with the given name; More... | |
SupervisableDescription[] | ListSubordinates () |
Lists the subordinates. More... | |
SupervisableState | GetSubordinateState (string name) |
Gets the state of the subordinate. More... | |
override object | InitializeLifetimeService () |
Ensures this remotable object's lease never times out. Subclassed supervisors wanting to manage leases more tightly should override this and not call this parent implementation. More... | |
![]() | |
void | Initialize (Apac.Configuration.SupervisableConfig config, Supervisors.ISupervisor exec) |
Initializes the component with the given SupervisableConfig (or derivative) and ISupervisor. More... | |
Protected Member Functions | |
virtual Licensing.AcquisitionResponse | OnRequestLocks (Licensing.LicensedFeatures features) |
Called when the license needs to be checked by a subordinate. More... | |
virtual Licensing.ReleaseResponse | OnReleaseLock (string acquisitionId) |
Called when the license needs to be released by a subordinate. More... | |
virtual void | OnInitialize (ConfigElement config) |
virtual void | OnStarting () |
abstract void | OnStart () |
Signals when Start() has been called. More... | |
abstract void | OnStop () |
Signals when Stop() has been called. More... | |
virtual void | OnStateChanging (SupervisableState currentState, SupervisableState newState) |
Signals when the state is changing. More... | |
virtual void | OnStateChanged (SupervisableState previousState, SupervisableState newState) |
virtual void | OnException (Exception ex) |
virtual ISupervisable | OnLocateSupervisableAgent (string name) |
Provides subclasses the opportunity to override the agent lookup process. More... | |
virtual ISupervisable[] | OnLocateSupervisableAgents (Predicate< ISupervisable > predicate, bool askExec) |
void | SetState (SupervisableState newState) |
Changes the state of the supervisor 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 | OnSupervisableHeartbeat (ISupervisable sender, DateTime heartbeat) |
This signature was carefully chosen to let a subordinate report its heartbeat OR to let a supervisor report a subordinate heartbeat up the controll chain. More... | |
virtual void | OnSubordinateStateChanging (ISupervisable sender, SupervisableStateChangeEventArgs args) |
virtual void | OnSubordinateStateChanged (ISupervisable sender, SupervisableStateChangeEventArgs args) |
virtual void | OnSubordinateHeartbeat (ISupervisable sender, EventArgs args) |
virtual void | OnSubordinateErrored (ISupervisable sender, SupervisableErroredEventArgs args) |
Properties | |
string | Name [get] |
Gets the configured name for the supervisor. More... | |
string | Description [get] |
Get the configured description for the supervisor. More... | |
bool | Prioritized [get] |
Indicates if the supervisor should be executed on a higher thread priority. More... | |
DateTime | LastHeartbeat [get] |
Gets the last heartbeat. More... | |
bool | IsRunning [get] |
Gets a value indicating whether this instance is running. More... | |
Supervisors.ISupervisor | ExecutiveSupervisor [get] |
Gets the excecutive supervisor. 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... | |
SupervisableState | CurrentState [get] |
Gets the state of the supervisor. More... | |
SupervisableState | PreviousState [get] |
Gets the previos state of the supervisor. More... | |
Exception | LastException [get] |
Gets the last exception that occured in the supervisor. More... | |
SupervisableCollection | Subordinates [get] |
Lazy-initialized list of components that are supervised by this supervisor. More... | |
log4net.ILog | Log [get] |
Gets the log4net.ILog for the instance. More... | |
![]() | |
SupervisableCollection | Subordinates [get] |
![]() | |
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 | |
SupervisableErroredHandler | SubordinateErrored |
SupervisableHeartbeatHandler | SubordinateHeartbeat |
SupervisableStateChangingHandler | SubordinateStateChanging |
SupervisableStateChangedHandler | SubordinateStateChanged |
SupervisableStateChangedHandler | SupervisableStateChanged |
This event is raised when the supervised state changes. For this event the arguments will contain the previous state and the new state. More... | |
SupervisableStateChangingHandler | SupervisableStateChanging |
This event is raised just prior to the supervised state being changed. For this event the arguments will only contain the current state; use SupervisableStateChangeEventArgs.CurrentState as SupervisableStateChangeEventArgs.CurrentState will always contain SupervisableState.Unknown. More... | |
SupervisableErroredHandler | SupervisableErrored |
This event is raised if an exception is encountered by a supervisor. More... | |
SupervisableHeartbeatHandler | SupervisableHeartbeat |
This event is raised on a periodic basis as a heartbeat to the supervisor. More... | |
![]() | |
SupervisableStateChangingHandler | SubordinateStateChanging |
SupervisableStateChangedHandler | SubordinateStateChanged |
SupervisableErroredHandler | SubordinateErrored |
SupervisableHeartbeatHandler | SubordinateHeartbeat |
![]() | |
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... | |
The base implementation for ISupervisor providing controls for initializing, starting, and stopping configured ISupervisable instances.
|
inline |
Adds a subordinate under the control of the supervisor.
subordinate | The object to be controlled by the supervisor. |
Implements Apac.Supervisors.ISupervisor.
|
inline |
Prompts the subordinates to check their references' states (supervisors don't have references).
Implements Apac.ISupervisable.
|
inline |
Gets the state of the subordinate.
name | The name. |
Implements Apac.Supervisors.ISupervisor.
|
inline |
Initialized the supervisor from configuration.
config | The configuration object holding the settings. |
Implements Apac.Supervisors.ISupervisor.
|
inline |
Do basic initialization of simple supervisable configuraiton.
config | The configuration object holding the settings. |
|
inline |
Ensures this remotable object's lease never times out. Subclassed supervisors wanting to manage leases more tightly should override this and not call this parent implementation.
|
inline |
|
inline |
Initiates the call chain to locate the supervisable agent with the given name.
name | The name of the requested agent. |
null
.Implements Apac.Supervisors.ISupervisor.
|
inline |
Initiates the call chain to locate the supervisable agent with the given name.
predicate | The Predicate<ISupervisable> provided by the caller for matching against supervisable agents. |
Implements Apac.Supervisors.ISupervisor.
|
inlineprotectedvirtual |
Provides subclasses the opportunity to override the agent lookup process.
type | The type of agent being requested. |
name | The name of the agent being requested, as defined in the configuration. |
null
.Reimplemented in Apac.Supervisors.ExecutiveSupervisor.
|
inlineprotectedvirtual |
Called when the license needs to be released by a subordinate.
acquisitionId | The acquisition id. |
null
by default, but overloads return a valid instance of Licensing.ReleaseResponse indicating the result of the release operation.Reimplemented in Apac.Supervisors.ExecutiveSupervisor.
|
inlineprotectedvirtual |
Called when the license needs to be checked by a subordinate.
features | The features. |
null
by default, but overloads return a valid instance of Licensing.AcquisitionResponse indicating the result of the request.
|
protectedpure virtual |
Signals when Start() has been called.
Implemented in Apac.Supervisors.ExecutiveSupervisor, Apac.Supervisors.DataSupervisor, and Apac.Supervisors.ControllerSupervisor.
|
inlineprotectedvirtual |
Signals when the state is changing.
currentState | The SupervisableState from which the instance is changing. |
newState | The SupervisableState to which the instance is changing. |
|
protectedpure virtual |
Signals when Stop() has been called.
Implemented in Apac.Supervisors.ExecutiveSupervisor, Apac.Supervisors.DataSupervisor, and Apac.Supervisors.ControllerSupervisor.
|
inlineprotectedvirtual |
This signature was carefully chosen to let a subordinate report its heartbeat OR to let a supervisor report a subordinate heartbeat up the controll chain.
sender | The subordinate reporting the error. |
heartbeat | The timestamp of the heartbeat. |
|
inline |
Removes the subordinate with the given name;
name | The name of the subordinate to be removed. |
Implements Apac.Supervisors.ISupervisor.
|
inline |
This default implementation will return null
.
features |
Implements Apac.Supervisors.ISupervisor.
|
inline |
Prompts subordinates to resolve their references (supervisors don't have references).
Implements Apac.ISupervisable.
|
inlineprotected |
Changes the state of the supervisor to the new state.
newState | The new state for the supervisor. |
This method will not notify or make changes if the new state is not different from the current state.
|
inline |
Instructs the supervisor to start operations. This call results in a No-Op if the supervisor is not in a Stopped or Initialized state.
Implements Apac.ISupervisable.
|
inline |
Signals that Start() will soon be called on the component. This can be used as an opportunity to perform preparatory activity, like checking the state of referenced components and similar actions.
Implements Apac.ISupervisable.
|
inline |
Starts the subordinate with the given name;
name | The name of the subordinate to be started. |
Implements Apac.Supervisors.ISupervisor.
|
inline |
Instructs the supervisor to stop operations. This call results in a No-Op if the supervisor is not running.
Implements Apac.ISupervisable.
|
inline |
Stops the subordinate with the given name;
name | The name of the subordinate to be stopped. |
Implements Apac.Supervisors.ISupervisor.
|
get |
Gets the state of the supervisor.
|
get |
Get the configured description for the supervisor.
|
get |
Gets the excecutive supervisor.
|
get |
Gets a value indicating whether this instance is running.
true
if this instance is running; otherwise, false
.
|
get |
Gets the last exception that occured in the supervisor.
|
get |
Gets the last heartbeat.
The last heartbeat.
|
getprotected |
Gets the log4net.ILog for the instance.
|
get |
Gets the configured name for the supervisor.
|
get |
Gets the previos state of the supervisor.
|
get |
Indicates if the supervisor should be executed on a higher thread priority.
|
get |
Gets the time this supervisable component was started.
|
get |
Gets the time this supervisable component was stopped.
|
get |
Lazy-initialized list of components that are supervised by this supervisor.
|
get |
Gets the amount of time this supervisable component has been running, or did run before it was stopped (if IsRunning is false
).
SupervisableErroredHandler Apac.Supervisors.Supervisor.SupervisableErrored |
This event is raised if an exception is encountered by a supervisor.
SupervisableHeartbeatHandler Apac.Supervisors.Supervisor.SupervisableHeartbeat |
This event is raised on a periodic basis as a heartbeat to the supervisor.
SupervisableStateChangedHandler Apac.Supervisors.Supervisor.SupervisableStateChanged |
This event is raised when the supervised state changes. For this event the arguments will contain the previous state and the new state.
SupervisableStateChangingHandler Apac.Supervisors.Supervisor.SupervisableStateChanging |
This event is raised just prior to the supervised state being changed. For this event the arguments will only contain the current state; use SupervisableStateChangeEventArgs.CurrentState as SupervisableStateChangeEventArgs.CurrentState will always contain SupervisableState.Unknown.