Yeah, I see how you can apply them to the <bus> theoretically. The problem is the initialize(Bus) code looks like this:

    public void initialize(Bus bus) {
       
        // this should never be null as features are initialised only
        // after the bus and all its extensions have been created
       
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
       
        synchronized (pe) {
            pe.setEnabled(true);
            pe.setIgnoreUnknownAssertions(ignoreUnknownAssertions);
            if (null != namespace) {
                PolicyConstants pc = bus.getExtension(PolicyConstants.class);
                pc.setNamespace(namespace);
            }
            if (null != alternativeSelector) {
                pe.setAlternativeSelector(alternativeSelector);
            }
        }

Nowhere is it actually telling the policy engine about the policies that are attached to the WSPolicyFeature. Hence putting a <Policy> inside a <bus> doesn't really do anything.

- Dan

Glen Mazza wrote:
The cxf.xml file is for bus configuration.  Maybe [1] can give you an
idea how this is done.

HTH,
Glen

[1]
http://cwiki.apache.org/CXF20DOC/wsrmconfiguration.html#WSRMConfiguration-UsingtheReliableMessagingFeature


Am Sonntag, den 16.12.2007, 18:25 -0500 schrieb Dan Diephouse:
  
I was trying to figure out how to apply a WS-Policy globally today to 
the CXF Bus, but I'm not sure I really understand how to do it or if its 
possible. The WSPolicyFeature just seems to apply policies to 
Client/Servers.  initialize(Bus) seems to be written with the mistaken 
assumption that it is being called to initialize the WSPolicyFeature. 
But thats simply not the case - its being called to initialize global 
Bus level policies which apply to *everything*.

I'm happy to go about fixing this, but I can't seem to deduce how to use 
the PolicyEngine to enable a global policy. Any ideas?

- Dan

    

  


-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog

Reply via email to