Skip to main content
Jump to: navigation, search

Orion/Documentation/Developer Guide/Configuration services

< Orion‎ | Documentation‎ | Developer Guide
Revision as of 11:46, 27 August 2012 by (Talk | contribs) (

Overview of configuration services

Orion provides a number of service APIs related to service configuration.

The service, also called ConfigurationAdmin, provides management of configuration data. Configuration data is persistent information that is provided to Managed Services. Internally, the ConfigurationAdmin service is used by the Plugin Settings page to manage the values of settings.

This service is analogous to the OSGi ConfigurationAdmin.

The service methods are:

Returns a Configuration with the given PID, creating a new Configuration if one does not already exist.
Returns an array of all current Configuration objects.

Refer to in the client API reference for a full description of this service's API methods.

Here is an example of how to use the ConfigurationAdmin service to print out all existing configurations and their property values:

var configurations = serviceRegistry.getService("").listConfigurations().then(function(configurations) {
        configurations.forEach(function(configuration) {
            var properties = configuration.getProperties();
            var propertyInfo = Object.keys(properties).map(function(propertyName) {
                if (propertyName !== "pid") {
                    return "\n        " + propertyName + ": " + JSON.stringify(properties[propertyName]) + "\n";
            console.log("Configuration pid: " + configuration.getPid() + "\n"
                      + "  properties: {" + propertyInfo + "\n"
                      + "  }");

The result might look something like this:

Configuration pid: nonnls.config
  properties: {
        enabled: false
Configuration pid: jslint.config
  properties: {
        options: "laxbreak:true, maxerr:50"

Contributes type definitions, which may be associated with a service's configuration. This is analogus to the OSGi Metatype.

Contributes a managed service. A managed service is a service that can receive configuration info. This is analogus to the OSGi Managed Service.

See also

Plugging into the settings page

Back to the top