Versions Compared

Key

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

...

Code Block
xml
xml
<wsrmp:RMAssertion xmlns:wsrmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
    <wsrmp:AcknowledgementInterval Milliseconds="30000"/>
</wsrmp:RMAssertion>
<wsrmp:RMAssertion xmlns:wsrmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
    <wsrmp:AcknowledgementInterval Milliseconds="50000"/>
</wsrmp:RMAssertion>

To sum up, the typical policy specific work of an interceptor would consists in the following:

...


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(...);
        }       
    }
}

Verification

Another set if interceptors installed by the policy framework are respoisble for verifying that one of the alternatives in the effective policy of the underlying message could indeed be supported. These are:

...