Aborted Execution of a Handler Pipeline
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. |
Some handlers may interrupt the processing pipeline. For example, an Authorization Handler will perform a permission check as a pre-processing task before the Policy Injection Application Block calls the target method or accesses the target property. If authorization fails, the handler will interrupt the pipeline and return control to the previous handler—or to the client code if this is the first handler in the pipeline.
The result in this example is that an authorization failure will prevent the Policy Injection Application Block from executing any remaining pre-processing tasks and from invoking the target method or accessing the target property. In addition, the only post-processing tasks that can execute will be those earlier in the pipeline than the Authorization Handler.
Effectively, the handler short-circuits the pipeline processing chain by aborting all following pipeline execution and target member invocation, and passing control back to the previous handler in the chain. In a similar way, a handler that performs validation can abort all following pipeline execution and target member invocation if it detects a validation failure during the pre-processing handler pipeline. However, in both cases, a Logging Handler earlier in the pipeline will still be able to log the authorization or validation failure during its post-processing task.