Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

This class represents an assertion without any attributes or child elements (in particular without a nested Policy element). The AnonymousResponses or NonAnonymousResponses assertions in the addressing metadata namespace http://www.w3.org/2007/01/addressing/metadataImage Removed are example of this type of assertions. The implementation of the equal and normalize methods in the class are trivial, and there should be no need to extend this class.

...

It is also possible to implement policy interceptor provider programmatically from scratch. It's constructor gives assertions QNames as argument of super constructor and adds corresponded interceptors using getters:

Code Block
public class AuthorizationInterceptorProviderMyInterceptorProvider extends AbstractPolicyInterceptorProvider {
    private static final long serialVersionUID = -5248428637449096540L;
    private static final AuthorizationInInterceptorMyInInterceptor IN_AUTHZINTERCEPTOR = new MyInInterceptor();
    private static final MyOutInterceptor OUT_INTERCEPTOR = new AuthorizationInInterceptorMyOutInterceptor();
    private static final AuthorizationInInterceptorMyOutFaultInterceptor OUT_AUTHZFAULT_INTERCEPTOR = new AuthorizationOutInterceptorMyOutFaultInterceptor();
    
    private static final Collection<QName> ASSERTION_TYPES;
    static {
        ASSERTION_TYPES = new ArrayList<QName>();
        ASSERTION_TYPES.add(AuthorizationConstants.AUTHORIZATION_ASSERTION(new QName("www.mycompany.org", "myassertion"));
    }

    public AuthorizationInterceptorProviderMyInterceptorProvider() {
        super(ASSERTION_TYPES);
        getInInterceptors().add(IN_AUTHZINTERCEPTOR);        
        getOutInterceptors().add(OUT_INTERCEPTOR);        
        getOutInterceptorsgetOutFaultInterceptors().add(OUT_AUTHZFAULT_INTERCEPTOR);        
    }
}

Since version 2.5.2, Assertion builder and policy interceptor provider can be registered using CXF bus extension mechanism: just create a file META-INF/cxf/bus-extensions.txt containing the following:

Code Block

org.company.MyInterceptorProvider::true
org.company.MyAssertionBuilder::true

Boolean value at the end specifies lazy loading strategy.
CXF automatically recognizes the assertion builder and policy interceptor provider and store them into registries: AssertionBuilderRegistry and PolicyInterceptorProviderRegistry.
Since CXF 2.6.0 it is possible to register multiple interceptor providers for single assertion.

Implementing a Policy-Aware Conduit/Destination

...