Interface ILinePlugIn2
Interface for line plug-ins.
public interface ILinePlugIn2
Remarks
Line plug-ins must do the following:
- Implement this interface.
- Provide a public constructor with optional injectable dependency parameters (see below).
Line plug-ins can optionally do the following:
- Provide public settable properties that can be configured via the line configuration.
- Implement IDisposable. Dispose() will be called when the line is being cleaned up.
The order of processing is as follows:
- As the line is being initialized, the line plug-in is created via its public constructor, supplying dependencies as requested.
- Any plug-in parameters included in the line configuration are set via the property setters on the newly-created plug-in instance.
- Initialize(string, ILineService) is called. The plug-in typically adds event handlers to the passed-in ILineService object.
- As the line operates, the plug-in performs its custom behavior.
- When the line is shutting down and being cleaned up, if the plug-in implemenets IDisposable, then Dispose() is called.
Dependencies that can be injected include:
- IConfigurationRoot, reflecting the effective configuration settings for this plug-in.
- Acuit.Pinpoint.HealthChecks.IHealthCheckService
- ILineService, providing the line services object for the containing line.
- INotificationService
- ObjectCache
- Acuit.Pinpoint.Timing.ITimeService
Methods
Initialize(string, ILineService)
Tells the plug-in to initialize itself.
void Initialize(string plugInName, ILineService lineService)
Parameters
plugInName
stringThe plug-in name, as configured in the line configuration.
lineService
ILineServiceThe line services object.
Remarks
If the plug-in's implementation of this method throws an exception, the plug-in will be immediately disposed and not tracked by Acuit Pinpoint Server. However, if the plug-in subscribed to any events before throwing the exception, those subscriptions will stay in effect. Thus, the plug-in should either (1) add error handling within this method to unsubscribe from events (and otherwise undo any initialization) before throwing the exception, or (2) implement IDisposable and perform that cleanup within Dispose().
InvokePlugIn(string, string)
Invokes the plug-in for any custom purpose.
string InvokePlugIn(string methodName, string parameter)
Parameters
methodName
stringA name that specifies a method to invoke.
parameter
stringA parameter for the method.
Returns
- string
Data from the method.
Remarks
This is available to allow a workstation plug-in to interact with the server plug-in.