|
Page Edited :
CXF20DOC :
WS-Policy Framework Overview
WS-Policy Framework Overview has been edited by Andrea Smyth (Apr 11, 2007). Content:The WS-Policy framework provides infrastructure and APIs that allow CXF users and developers to use WS-Policy. It is compliant with the November 2006 draft publications of the Web Services Policy 1.5 - Framework The framework consists of a core runtime and APIs that allow developers to plug in support for their own domain assertions: CoreThe core is responsible for:
Policy operations such as merge and normalisation (but not intersection) are based on Apache Neethi APIsAssertionBuilderThe AssertionBuilder API is a concept from Neethi, slightly modified to avoid the dependency on the Axis object model, and extended to include support for domain specific behaviour of intersection and comparison of assertions. public interface AssertionBuilder { // build an Assertion object from a given DOM element Assertion build(Element element); // return the schema type names of assertions understood by this builder Collection<QName> getSupportedTypes(); // return an Assertion object that is compatible with the specified assertions Assertion buildCompatible(Assertion a, Assertion b); }
PolicyInterceptorProviderThis API is used to automatically engage interceptors required to support domain specific assertions at runtime, thus simplifying interceptor configuration a lot. public interface PolicyInterceptorProvider extends InterceptorProvider { // return the schema types of the asssertions that can be supported Collection<QName> getAssertionTypes() } Currently, CXF supports PolicyInterceptorProvider implementations for the following assertion types:
In addition, there is an API to refine domain _expression_(s) (xml elements describing policy subjects within a policy scope) in policy attachments. There is currently only one working implementation for EndpointReferenceType domain expressions (matching over the address). Another implementation, using XPath expressions, is in work. Interaction with the FrameworkComponents interact with the policy framework typically to
Like most other CXF features, the policy framework is itself largely interceptor based. Thus, most interaction with the framework is indirect through the Message object: Policy interceptors make AssertionInfo objects available as a message property to subsequently executing, policy-aware interceptors like the WS-Addressing and WS-RM interceptors. These interceptors extract the AssertionInfo objects from the Message, allowing them to performs steps 1. and 2. above: import org.apache.neethi.Assertion; public class AssertionInfo { ... public boolean isAsserted() {...} public void setAsserted(boolean asserted) {...} public Assertion getAssertion() {...} } Conduits and destinations may also want to assert their capabilities. However they cannot normally wait for Assertion information being made available to them via the Message object: An example for conduit/destination based assertion are the HTTP conduit and destination, which support assertions of element type HTTPClientPolicy and HTTPServerPolicy resp.. |
Unsubscribe or edit your notifications preferences
