AP&C API Reference
Public Member Functions | Static Public Attributes | Properties | List of all members
Apac.Configuration.PluginCache< T > Class Template Reference

The plugin cache is a load once (and load on demand) global cache for the application to assess, dynamically load, and have available all plugable types in the system (measurement formulae, actions, etc). It is driven by configuration to determine which directories are suitable for loading plugins, allowing the system administrator to control permissions in a secure manner. All plugins are indexed by their Id (GUID) property. More...

Inheritance diagram for Apac.Configuration.PluginCache< T >:

Public Member Functions

void Reload ()
 Reloads all aspects of the cache. More...
 
MeasurementFormula GetFormula (Guid id)
 Gets the formula with the specified identifier. More...
 
PluginDescriptor GetFormulaDescriptor (string typeName)
 Gets the formula with the specified type name (Type.FullName). More...
 
MeasurementFormula GetFormula (Predicate< PluginDescriptor > match)
 Gets the first formula matching the specified predicate. More...
 
IEnumerable< MeasurementFormulaGetFormulae ()
 Gets all formulae. More...
 
FormulaDescriptor[] GetFormulaDescriptors ()
 Gets the plugin descriptors for the loaded formulae. More...
 
IAction GetAction (Guid id)
 Gets the alert action with the specified identifier. More...
 
IEnumerable< IActionGetActions ()
 Gets all alert actions. More...
 
PluginDescriptor[] GetActionDescriptors ()
 Gets the plugin descriptors for the loaded alert actions. More...
 
MeasurementUnit GetMeasurementUnit (Predicate< MeasurementUnit > predicate)
 Gets the first measurement unit that matches based on the given predicate . More...
 
MeasurementUnit[] GetMeasurementUnits (Predicate< MeasurementUnit > predicate)
 Gets all measurement units that match based on the given predicate . More...
 
MeasurementUnit[] GetMeasurementUnits ()
 Gets the measurement units. More...
 

Static Public Attributes

static readonly string DefaultPluginPathsSection = "apac/pluginPaths"
 The name of the configuration section needed for loading the plugin paths. More...
 
static readonly string PluginPathsSectionName = "pluginPathsSection"
 The name of the appSettings key used to reference the configuration section that holds the paths to the plugins. If not provided, or if the referenced section does not exist, then the DefaultPluginPathsSection is used. More...
 
static readonly string FormulaPathKey = "formulaPath"
 The key name used to define the paths that can contain measurement formula implementations. More...
 
static readonly string ActionPathKey = "actionPath"
 The key name used to define the paths that can contain action implementations. More...
 
static readonly string UnitsPathKey = "measurementUnitsPath"
 The key name used to define the paths that can contain measurement units. More...
 
static readonly string PluginPathKey = "allPluginsPath"
 The key name used to define the paths that can store any plugin implementations. Assemblies stored in this path will be searched' for all types of plugins (measurement formula, alert actions, threshold actions, etc). More...
 

Properties

static PluginCache< T > Cache [get]
 Gets the singleton cache. More...
 

Detailed Description

The plugin cache is a load once (and load on demand) global cache for the application to assess, dynamically load, and have available all plugable types in the system (measurement formulae, actions, etc). It is driven by configuration to determine which directories are suitable for loading plugins, allowing the system administrator to control permissions in a secure manner. All plugins are indexed by their Id (GUID) property.

Template Parameters
T

Because this cache must be marshalled across application boundaries it implements the Singleton pattern rather than being just a static class.

Type Constraints
T :IComparable 

Member Function Documentation

◆ GetAction()

IAction Apac.Configuration.PluginCache< T >.GetAction ( Guid  id)
inline

Gets the alert action with the specified identifier.

Parameters
idThe id.
Returns
Returns the desired alert action or null.

◆ GetActionDescriptors()

PluginDescriptor [] Apac.Configuration.PluginCache< T >.GetActionDescriptors ( )
inline

Gets the plugin descriptors for the loaded alert actions.

Returns
Returns an T:PluginDescriptor[] or null.

◆ GetActions()

IEnumerable<IAction> Apac.Configuration.PluginCache< T >.GetActions ( )
inline

Gets all alert actions.

Returns
Returns an IEnumerable<IAction> reference to all values in the cache of alert actions.

◆ GetFormula() [1/2]

MeasurementFormula Apac.Configuration.PluginCache< T >.GetFormula ( Guid  id)
inline

Gets the formula with the specified identifier.

Parameters
idThe id.
Returns
Returns the desired formula or null.

◆ GetFormula() [2/2]

MeasurementFormula Apac.Configuration.PluginCache< T >.GetFormula ( Predicate< PluginDescriptor match)
inline

Gets the first formula matching the specified predicate.

Parameters
idThe id.
Returns
Returns the desired formula or null.

◆ GetFormulaDescriptor()

PluginDescriptor Apac.Configuration.PluginCache< T >.GetFormulaDescriptor ( string  typeName)
inline

Gets the formula with the specified type name (Type.FullName).

Parameters
typeNameThe name of the type being sought.
Returns
Returns the desired formula or null.

◆ GetFormulaDescriptors()

FormulaDescriptor [] Apac.Configuration.PluginCache< T >.GetFormulaDescriptors ( )
inline

Gets the plugin descriptors for the loaded formulae.

Returns
Returns an T:PluginDescriptor[] or null;

◆ GetFormulae()

IEnumerable<MeasurementFormula> Apac.Configuration.PluginCache< T >.GetFormulae ( )
inline

Gets all formulae.

Returns
Returns an T:IEnumerable<MeasurementFormula<T>> reference to all values in the cache of formulae.

◆ GetMeasurementUnit()

MeasurementUnit Apac.Configuration.PluginCache< T >.GetMeasurementUnit ( Predicate< MeasurementUnit predicate)
inline

Gets the first measurement unit that matches based on the given predicate .

Parameters
predicateThe predicate.
Returns
Returns a MeasurementUnit if a match is found, or null if not.

◆ GetMeasurementUnits() [1/2]

MeasurementUnit [] Apac.Configuration.PluginCache< T >.GetMeasurementUnits ( )
inline

Gets the measurement units.

Returns
Returns a T:MeasurementUnits[] or null.

◆ GetMeasurementUnits() [2/2]

MeasurementUnit [] Apac.Configuration.PluginCache< T >.GetMeasurementUnits ( Predicate< MeasurementUnit predicate)
inline

Gets all measurement units that match based on the given predicate .

Parameters
predicateThe predicate.
Returns
Returns a T:MeasurementUnit[], which may be empty if no match is found.

◆ Reload()

void Apac.Configuration.PluginCache< T >.Reload ( )
inline

Reloads all aspects of the cache.

Member Data Documentation

◆ ActionPathKey

readonly string Apac.Configuration.PluginCache< T >.ActionPathKey = "actionPath"
static

The key name used to define the paths that can contain action implementations.

◆ DefaultPluginPathsSection

readonly string Apac.Configuration.PluginCache< T >.DefaultPluginPathsSection = "apac/pluginPaths"
static

The name of the configuration section needed for loading the plugin paths.

◆ FormulaPathKey

readonly string Apac.Configuration.PluginCache< T >.FormulaPathKey = "formulaPath"
static

The key name used to define the paths that can contain measurement formula implementations.

◆ PluginPathKey

readonly string Apac.Configuration.PluginCache< T >.PluginPathKey = "allPluginsPath"
static

The key name used to define the paths that can store any plugin implementations. Assemblies stored in this path will be searched' for all types of plugins (measurement formula, alert actions, threshold actions, etc).

◆ PluginPathsSectionName

readonly string Apac.Configuration.PluginCache< T >.PluginPathsSectionName = "pluginPathsSection"
static

The name of the appSettings key used to reference the configuration section that holds the paths to the plugins. If not provided, or if the referenced section does not exist, then the DefaultPluginPathsSection is used.

◆ UnitsPathKey

readonly string Apac.Configuration.PluginCache< T >.UnitsPathKey = "measurementUnitsPath"
static

The key name used to define the paths that can contain measurement units.

Property Documentation

◆ Cache

Gets the singleton cache.

The cache.


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