Defining and Configuring Policies

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

A policy is a collection of matching rules that specifies how the Policy Injection Application Block selects classes and members to which it will attach a handler pipeline and a collection of the handlers that make up that pipeline. The matching rules defined within a policy identify the classes and/or members (public methods or properties) to which that policy will apply.

Where there is more than one matching rule, they must all evaluate to True for the policy to apply. It is possible for the collection of matching rules to select more than one object, method, or property if that object, method, or property matches every rule.

Note

If you configure multiple policies containing matching rules that select the same target object(s) or member(s), the Policy Injection Application Block will combine them in the order they occur in the configuration.

The next procedure describes how to create a new policy for the Policy Injection Application Block using the configuration tools.

To configure a new policy

  1. Right-click the Policy Injection Application Block node in the Enterprise Library Configuration Console or Visual Studio Configuration Editor, point to New, and then click Policy.
  2. In the right pane of the Enterprise Library Configuration Console, or in the Visual Studio Properties window, select the Name property, and then edit the default name "Policy" to the name you want to use for the new policy.
Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.