Package org.apache.ws.policy

Examples of org.apache.ws.policy.Policy


            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            Policy newPolicy = prdr.readPolicy(fis);
            newPolicy = (Policy) newPolicy.normalize();

            if (merged == null) {
                merged = newPolicy;
            } else {
                merged = (Policy) merged.merge(newPolicy);
View Full Code Here


    List wsdlPolicies = getPoliciesAsExtElements(wsdlDefinition
        .getExtensibilityElements());
    Iterator wsdlPolicyIterator = wsdlPolicies.iterator();

    while (wsdlPolicyIterator.hasNext()) {
      Policy wsdlPolicy = (Policy) wsdlPolicyIterator.next();

      if (wsdlPolicy.getPolicyURI() != null) {
        policyInclude.registerPolicy(wsdlPolicy);
      }
    }

    axisService.setPolicyInclude(policyInclude);
View Full Code Here

            PolicyInclude policyInclude) {
        OMPolicyReader reader = (OMPolicyReader) PolicyFactory
                .getPolicyReader(PolicyFactory.OM_POLICY_READER);

        while (policyElements.hasNext()) {
            Policy p = reader.readPolicy((OMElement) policyElements.next());
            policyInclude.addPolicyElement(type, p);
        }
    }
View Full Code Here

            Iterator iterator = policyElements.iterator();

            while (iterator.hasNext()) {

                Object policyElement = ((PolicyElement) iterator.next()).value;
                Policy p = null;

                if (policyElement instanceof PolicyReference) {
                    p = (Policy) ((PolicyReference) policyElement)
                            .normalize(getPolicyRegistry());

                } else if (policyElement instanceof Policy) {
                    p = (Policy) policyElement;

                } else {
                    // TODO an exception ?
                }
                policy = (policy == null) ? (Policy) p.normalize(reg)
                        : (Policy) policy.merge(p, reg);
            }
        }

        return policy;
View Full Code Here

        if (effectivePolicy != null) {
            return effectivePolicy;
        }

        Policy parentEffectivePolicy = parent.getEffectivePolicy();

        if (parent == null || parentEffectivePolicy == null) {
            return getPolicy();
        }

        if (getPolicy() != null) {
            return parent.getEffectivePolicy();
        }

        return (Policy) parentEffectivePolicy.merge(getPolicy(), reg);

    }
View Full Code Here

            // It should work in all containers, server/client side
            UnifiedVirtualFile vfPolicyFile = vfRoot.findChild(policyFileLocation);
            is = vfPolicyFile.toURL().openStream();
           
            DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
            Policy unnormalizedPolicy = reader.readPolicy(is);
            Policy normPolicy = (Policy)unnormalizedPolicy.normalize();
            log.info("Deploying Annotated Policy = " + policyFileLocation);
            PolicyScopeLevel scope = anPolicy.scope();
            if (PolicyScopeLevel.WSDL_PORT.equals(scope) || PolicyScopeLevel.WSDL_PORT_TYPE.equals(scope) || PolicyScopeLevel.WSDL_BINDING.equals(scope))
            {
               deployPolicy(normPolicy, scope, epMetaData);
View Full Code Here

      //Collect all policies defined in our wsdl definitions
      DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
      PolicyRegistry localPolicyRegistry = new PolicyRegistry();
      for (WSDLExtensibilityElement policyElement : wsdlDefinitions.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY))
      {
         Policy policy = reader.readPolicy(policyElement.getElement());
         localPolicyRegistry.register(policy.getPolicyURI(), policy);
      }
      //Port scope
      WSDLService wsdlService = wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName());
      if (wsdlService != null)
      {
View Full Code Here

      }
   }

   private Policy resolvePolicyReference(PolicyReference policyRef, PolicyRegistry localPolicies)
   {
      Policy normPolicy;
      try
      {
         normPolicy = (Policy)policyRef.normalize(localPolicies);
      }
      catch (RuntimeException e)
View Full Code Here

         ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
         extMetaData.addExtension(ext);
      }
      try
      {
         Policy deployedPolicy = deployer.deployServerside(policy, extMetaData);
         ext.addPolicy(scope, deployedPolicy);
      }
      catch (UnsupportedPolicy e)
      {
         log.warn("Policy Not supported:" + policy.getPolicyURI());
View Full Code Here

      {
         ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
         extMetaData.addExtension(ext);
      }
      FileInputStream fis = new FileInputStream(sourceFile);
      Policy policy = reader.readPolicy(fis);
      fis.close();
      ext.addPolicy(scope, policy);
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.policy.Policy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.