Interface ILinePlugIn
An Acuit Pinpoint Server line plug-in.
[CLSCompliant(false)]
public interface ILinePlugIn
Remarks
Line plug-ins must do the following:
- Implement this interface.
- Provide a public constructor with whatever dependencies are required specified as arguments to the constructor.
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, either when the Acuit Pinpoint Server service is stopping, or when the line is being reinitialized due to configuration changes.
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, PlugInHostContext) is called. The plug-in typically adds event handlers via an ILineService dependency.
- 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.
Methods
Initialize(string, PlugInHostContext)
Tells the plug-in to initialize itself.
void Initialize(string plugInName, PlugInHostContext hostContext)
Parameters
plugInNamestringThe plug-in name, as configured in the line configuration.
hostContextPlugInHostContextContext about the host environment for the plug-in. Configuration will reflect the unique effective configuration settings for this individual line plug-in. Properties will be the same dictionary as was used when initializing the plug-in assemblies and plug-in modules in this assembly load context specific to the plug-in directory.
Remarks
If the plug-in's implementation of this method throws an exception, the plug-in will be immediately disposed (if it implements IDisposable) 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
methodNamestringA name that specifies a method to invoke.
parameterstringAn optional parameter for the method.
Returns
- string
The returned data from the method.
Remarks
This can be used to allow a workstation plug-in to interact with the server plug-in.
Exceptions
- NotSupportedException
The plug-in does not support invoked methods.
- ArgumentException
methodNameis not a valid method name.