FileDocCategorySizeDatePackage
FastInfosetModelConfiguratorProvider.javaAPI DocExample4896Tue May 29 16:56:32 BST 2007com.sun.xml.ws.encoding.policy

FastInfosetModelConfiguratorProvider

public class FastInfosetModelConfiguratorProvider extends Object implements com.sun.xml.ws.policy.jaxws.spi.ModelConfiguratorProvider
A configurator provider for FastInfoset policy assertions.
author
Paul.Sandoz@Sun.Com

Fields Summary
public static final QName
enabled
Constructors Summary
Methods Summary
public voidconfigure(com.sun.xml.ws.api.model.wsdl.WSDLModel model, com.sun.xml.ws.policy.PolicyMap policyMap)
Process FastInfoset policy assertions.

param
model the WSDL model.
param
policyMap the policy map.

    
                       
              
        assert model != null;
        assert policyMap != null;
        
        for (WSDLService service:model.getServices().values()) {
            for (WSDLPort port : service.getPorts()) {
                PolicyMapKey key = PolicyMap.createWsdlEndpointScopeKey(service.getName(),port.getName());
                Policy policy = policyMap.getEndpointEffectivePolicy(key);
                if (null!=policy && policy.contains(OPTIMIZED_FI_SERIALIZATION_ASSERTION)) {
                    Iterator <AssertionSet> assertions = policy.iterator();
                    while(assertions.hasNext()){
                        AssertionSet assertionSet = assertions.next();
                        Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
                        while(policyAssertion.hasNext()){
                            PolicyAssertion assertion = policyAssertion.next();
                            if(OPTIMIZED_FI_SERIALIZATION_ASSERTION.equals(assertion.getName())){
                                String value = assertion.getAttributeValue(enabled);
                                boolean isFastInfosetEnabled = Boolean.valueOf(value.trim());
                                port.addFeature(new FastInfosetFeature(isFastInfosetEnabled));
                            } // end-if non optional fast infoset assertion found
                        } // next assertion
                    } // next alternative
                } // end-if policy contains fast infoset assertion
            } // end foreach port
        } // end foreach service