Table of Contents

Interface ILinePlugIn

Namespace
Acuit.Pinpoint.Server
Assembly
Acuit.Pinpoint.Server.Abstractions.dll

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:

  1. As the line is being initialized, the line plug-in is created via its public constructor, supplying dependencies as requested.
  2. Any plug-in parameters included in the line configuration are set via the property setters on the newly-created plug-in instance.
  3. Initialize(string, PlugInHostContext) is called. The plug-in typically adds event handlers via an ILineService dependency.
  4. As the line operates, the plug-in performs its custom behavior.
  5. 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

plugInName string

The plug-in name, as configured in the line configuration.

hostContext PlugInHostContext

Context 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

methodName string

A name that specifies a method to invoke.

parameter string

An 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

methodName is not a valid method name.