CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Static Public Attributes | List of all members
ctkConfigurationPlugin Struct Referenceabstract

#include <Libs/PluginFramework/service/cm/ctkConfigurationPlugin.h>

Public Member Functions

virtual void modifyConfiguration (const ctkServiceReference &reference, ctkDictionary &properties)=0
 
virtual ~ctkConfigurationPlugin ()
 

Static Public Attributes

static const QString CM_RANKING
 
static const QString CM_TARGET
 

Detailed Description

A service interface for processing configuration dictionary before the update.

A plugin registers a ctkConfigurationPlugin object in order to process configuration updates before they reach the Managed Service or Managed Service Factory. The Configuration Admin service will detect registrations of Configuration Plugin services and must call these services every time before it calls the ctkManagedService or ctkManagedServiceFactory updated method. The Configuration Plugin service thus has the opportunity to view and modify the properties before they are passed to the Managed Service or Managed Service Factory.

Configuration Plugin (plugin) services have full read/write access to all configuration information. Therefore, plugins using this facility should be trusted. Access to this facility should be limited with ctkServicePermission[ctkConfigurationPlugin,REGISTER]. Implementations of a Configuration Plugin service should assure that they only act on appropriate configurations.

The integer service.cmRanking registration property may be specified. Not specifying this registration property, or setting it to something other than an integer, is the same as setting it to the integer zero. The service.cmRanking property determines the order in which plugins are invoked. Lower ranked plugins are called before higher ranked ones. In the event of more than one plugin having the same value of service.cmRanking, then the Configuration Admin service arbitrarily chooses the order in which they are called.

By convention, plugins with service.cmRanking< 0 or service.cmRanking > 1000 should not make modifications to the properties.

The Configuration Admin service has the right to hide properties from plugins, or to ignore some or all the changes that they make. This might be done for security reasons. Any such behavior is entirely implementation defined.

A plugin may optionally specify a cm.target registration property whose value is the PID of the Managed Service or Managed Service Factory whose configuration updates the plugin is intended to intercept. The plugin will then only be called with configuration updates that are targeted at the Managed Service or Managed Service Factory with the specified PID. Omitting the cm.target registration property means that the plugin is called for all configuration updates.

Definition at line 87 of file ctkConfigurationPlugin.h.

Constructor & Destructor Documentation

◆ ~ctkConfigurationPlugin()

virtual ctkConfigurationPlugin::~ctkConfigurationPlugin ( )
inlinevirtual

Definition at line 89 of file ctkConfigurationPlugin.h.

Member Function Documentation

◆ modifyConfiguration()

virtual void ctkConfigurationPlugin::modifyConfiguration ( const ctkServiceReference reference,
ctkDictionary properties 
)
pure virtual

View and possibly modify a set of configuration properties before they are sent to the Managed Service or the Managed Service Factory. The Configuration Plugin services are called in increasing order of their service.cmRanking property. If this property is undefined or is a non-integer type, 0 is used.

This method should not modify the properties unless the service.cmRanking of this plugin is in the range 0 <= service.cmRanking <= 1000.

If this method throws any exception, the Configuration Admin service must catch it and should log it.

Parameters
referencereference to the Managed Service or Managed Service Factory
propertiesThe configuration properties. This argument must not contain the "service.pluginLocation" property. The value of this property may be obtained from the ctkConfiguration::getPluginLocation method.

Member Data Documentation

◆ CM_RANKING

const QString ctkConfigurationPlugin::CM_RANKING
static

A service property to specify the order in which plugins are invoked.

This property contains an integer ranking of the plugin. Not specifying this registration property, or setting it to something other than an integer, is the same as setting it to the integer zero. This property determines the order in which plugins are invoked. Lower ranked plugins are called before higher ranked ones.

Definition at line 113 of file ctkConfigurationPlugin.h.

◆ CM_TARGET

const QString ctkConfigurationPlugin::CM_TARGET
static

A service property to limit the Managed Service or Managed Service Factory configuration dictionaries a Configuration Plugin service receives.

This property contains a QStringList of PIDs. A Configuration Admin service must call a Configuration Plugin service only when this property is not set, or the target service's PID is listed in this property.

Definition at line 101 of file ctkConfigurationPlugin.h.


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