Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are several steps involved in developing your domain specific assertions, these are:

  1. Implementing the Assertion and AssertionBuilder interfaces
  2. Registering the AssertionBuilder with the AssertionBuilderRegistry
  3. Providing runtime support for the Assertion - in form of an interceptor or inside a conduit or a destination.
    They are outlined in some more detail below:

Implementing the Assertion Interface

Implementing the AssertionBuilder Interface

Registering the AssertionBuilder with the AssertionBuilderRegistry

Implementing a Policy-Aware Interceptor

This 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:

Code Block
java
java
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