|
Page Created :
CXF20DOC :
Developing Assertions
Developing Assertions has been created by Andrea Smyth (Apr 12, 2007). Content:There are several steps involved in developing your domain specific assertions, these are:
Implementing the Assertion InterfaceImplementing the AssertionBuilder InterfaceRegistering the AssertionBuilder with the AssertionBuilderRegistryImplementing a Policy-Aware InterceptorThis is the easiest way of providing runtime support for an Assertion, and essentially consist in steps 1. and 2. described in Interaction with the Framework import org.apache.cxf.ws.policy.AssertionInfoMap;
class MyPolicyAwareInterceptor {
static final QName assertionType = new QName("http://mycompany.com}", "MyType"});
public void handleMessage(Message message) {
// get AssertionInfoMap
org.apache.cxf.ws.policy.AssertionInfoMap aim = message.get(org.apache.cxf.ws.policy.AssertionInfoMap.class);
Collection<AssertionInfo ais> = aim.get(assertionType );
// extract Assertion information
for (AssertionInfo ai : ais) {
org.apache.neethi.Assertion a = ai.getAssertion();
MyAssertionType ma = (MyAssertionType)a;
// digest ....
}
// process message ...
// express support
for (AssertionInfo ai : ais) {
ai.setAsserted(...);
} }
}
Implementing a Policy-Aware Conduit/Destination |
Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request
Unsubscribe or edit your notifications preferences
Unsubscribe or edit your notifications preferences
