Share via


The Manageable Configuration Source Class

This topic describes the classes that make up the ManageableConfigurationSource class.

ManageableConfigurationSource

The ManageableConfigurationSource class implements the IConfigurationSource interface. This class's behavior is similar to that of the FileConfigurationSource class that is also used in Enterprise Library. It reads the configuration data from a .config file and returns the data as ConfigurationSection objects. The ManageableConfigurationSource class first queries the registry for any group policy changes and merges these changes into the configuration file before handing the file to the application.

The ManageableConfigurationSource class delegates its responsibilities to an instance of the ManageableConfigurationSourceImplementation class. Instances of the ManageableConfigurationSource that have the same configuration file name, application name, and group policy Boolean value share an instance of the ManageableConfigurationSourceImplementation class.

ManageabilityHelper

Instances of the ManageabilityHelper class coordinate access to the Group Policy overrides from the registry. The ManageabilityHelper instances hold mappings from section names to instances of concrete subclasses of the ConfigurationSectionManageabilityProvider class that perform the manageability tasks for each section.

When the managed sections include polymorphic configuration objects (such as the configuration objects that describe different implementations of an abstract service on an application block), instances of ConfigurationSectionManageabilityProvider delegate the processing of the configuration elements to an instance of a concrete subclass of ConfigurationElementManageabilityProvider that is registered with the configuration element type.

The manageability providers for sections and elements are also responsible for generating the administrative (ADM) directives that represent the policies that describe the configuration objects they manage. This means that information about the structure of the registry keys in the ADM templates and information about how to retrieve that information is kept in a single place. Normally, these manageability providers are a parameter to the configuration source constructor; they are ultimately assigned to the manageability helper.

Either during its initialization, as a reaction to a change in the configuration, or as a reaction to a change notification from the group policy infrastructure, the ManageableConfigurationSourceImplementation class initiates an update to the configuration information. This class obtains a new configuration accessor that represents current values from the configuration files and invokes its instance of the ManageabilityHelper class to perform overrides based on the settings from the configuration accessor. After that, the ManageabilityHelper instance retrieves each configuration section for which it has a registered manageability provider, and it asks each provider to perform the Group Policy overrides for appropriate sections by invoking the OverrideWithGroupPolicies method.

The section manageability providers are responsible for reading the Group Policy overrides, overriding the section properties, and invoking the registered element manageability providers for the configuration objects contained in the section.

The ManageabilityHelper instance also removes sections with disabled policies. In this case, it is not necessary to call the registered manageability provider.

A group of interfaces provides access to external entities, such as the registry. The IRegistryAccessor and IRegistryKey interfaces define the access to the information from the registry. The RegistryAccessor and RegistryKey classes are the concrete implementations for these interfaces.