FileDocCategorySizeDatePackage
PolicyMapBuilder.javaAPI DocExample4663Tue May 29 16:56:36 BST 2007com.sun.xml.ws.policy.jaxws

PolicyMapBuilder

public class PolicyMapBuilder extends Object
Used for populating changes into PolicyMap. Once a PolicyMap is created PolicyMapBuilder notifies all the registered WSPolicyBuilderHandler to populate changes to the PolicyMap.
author
Jakub Podlesak (jakub.podlesak at sun.com)

Fields Summary
private List
policyBuilders
policyBuilders should contain list of registered PolicyBuilders
Constructors Summary
PolicyMapBuilder()
Creates a new instance of PolicyMapBuilder


        

               

     

        // nothing to initialize

    
Methods Summary
private com.sun.xml.ws.policy.PolicyMapgetNewPolicyMap(com.sun.xml.ws.policy.PolicyMapMutator externalMutators)
Iterates all the registered PolicyBuilders and lets them populate their changes into PolicyMap. Registers mutators from collection given as a parameter with the newly created map.


        final HashSet<PolicyMapMutator> mutators = new HashSet<PolicyMapMutator>();

        final PolicyMapExtender myExtender = PolicyMapExtender.createPolicyMapExtender();

        mutators.add(myExtender);

        if (null != externalMutators) {

            mutators.addAll(Arrays.asList(externalMutators));

        }

        final PolicyMap policyMap = PolicyMap.createPolicyMap(mutators);

        for(BuilderHandler builder : policyBuilders){

            builder.populate(myExtender);

        }

        return policyMap;

    
com.sun.xml.ws.policy.PolicyMapgetPolicyMap(com.sun.xml.ws.policy.PolicyMapMutator externalMutators)
Iterates all the registered PolicyBuilders and lets them populate their changes into PolicyMap. Registers mutators given as a parameter with the newly created map.


        return getNewPolicyMap(externalMutators);

    
voidregisterHandler(BuilderHandler builder)
Registers another builder, which has to be notified after a new PolicyMap is created in order to populate it's changes.


        if (null != builder) {

            policyBuilders.add(builder);

        }

    
voidunregisterAll()


        this.policyBuilders = null;