Package org.apache.ws.policy.util

Examples of org.apache.ws.policy.util.DOMPolicyReader


                    soapAddressExtensibiltyElement.setLocationURI(element.getAttribute("location"));
                    component.addExtensibilityElement(soapAddressExtensibiltyElement);
                   
                } else if (ExtensionConstants.POLICY.equals(unknown.getElementType())) {
                    PolicyExtensibilityElement policyExtensibilityElement = (PolicyExtensibilityElement) extensionFactory.getExtensionElement(wsdl4jElement.getElementType());
                    DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                    policyExtensibilityElement.setPolicyElement(policyReader.readPolicy(unknown.getElement()));                   
                    component.addExtensibilityElement(policyExtensibilityElement);
                   
                } else if (ExtensionConstants.POLICY_REFERENCE.equals(unknown.getElementType())) {
                    PolicyExtensibilityElement policyExtensibilityElement = (PolicyExtensibilityElement) extensionFactory.getExtensionElement(wsdl4jElement.getElementType());
                    DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                    policyExtensibilityElement.setPolicyElement(policyReader.readPolicyReference(unknown.getElement()));
                    component.addExtensibilityElement(policyExtensibilityElement);                  
                   
                }else{

                    DefaultExtensibilityElement defaultExtensibilityElement = (DefaultExtensibilityElement) extensionFactory
View Full Code Here


            throws DeploymentException {

        ArrayList policies = new ArrayList();

        Iterator extElements = extElementsList.iterator();
        DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory
                .getPolicyReader(PolicyFactory.DOM_POLICY_READER);
        Object extElement;

        while (extElements.hasNext()) {
            extElement = extElements.next();

            if (extElement instanceof UnknownExtensibilityElement) {
                UnknownExtensibilityElement e = (UnknownExtensibilityElement) extElement;
                Element element = e.getElement();
                if (PolicyConstants.WS_POLICY_NAMESPACE_URI.equals(element
                        .getNamespaceURI())
                        && PolicyConstants.WS_POLICY.equals(element
                        .getLocalName())) {
                    policies.add(reader.readPolicy(element));

                } else if (PolicyConstants.WS_POLICY_NAMESPACE_URI
                        .equals(element.getNamespaceURI())
                        && PolicyConstants.WS_POLICY_REFERENCE.equals(element
                        .getLocalName())) {

                    try {
                        policies.add(reader.readPolicyReference(element));

                    } catch (Exception ex) {
                        logger.debug(Messages.getMessage("policyprocessingerror"));
                        throw new DeploymentException(Messages.getMessage("policyprocessingerror"));
                    }
View Full Code Here

                    soapAddressExtensibiltyElement.setLocationURI(element.getAttribute("location"));
                    component.addExtensibilityElement(soapAddressExtensibiltyElement);

                } else if (ExtensionConstants.POLICY.equals(unknown.getElementType())) {
                    PolicyExtensibilityElement policyExtensibilityElement = (PolicyExtensibilityElement) extensionFactory.getExtensionElement(wsdl4jElement.getElementType());
                    DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                    policyExtensibilityElement.setPolicyElement(policyReader.readPolicy(unknown.getElement()));
                    component.addExtensibilityElement(policyExtensibilityElement);

                } else if (ExtensionConstants.POLICY_REFERENCE.equals(unknown.getElementType())) {
                    PolicyExtensibilityElement policyExtensibilityElement = (PolicyExtensibilityElement) extensionFactory.getExtensionElement(wsdl4jElement.getElementType());
                    DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                    policyExtensibilityElement.setPolicyElement(policyReader.readPolicyReference(unknown.getElement()));
                    component.addExtensibilityElement(policyExtensibilityElement);

                }else{

                    DefaultExtensibilityElement defaultExtensibilityElement = (DefaultExtensibilityElement) extensionFactory
View Full Code Here

      throws DeploymentException {

    ArrayList policies = new ArrayList();

    Iterator extElements = extElementsList.iterator();
    DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory
        .getPolicyReader(PolicyFactory.DOM_POLICY_READER);
    Object extElement;

    while (extElements.hasNext()) {
      extElement = extElements.next();

      if (extElement instanceof UnknownExtensibilityElement) {
        UnknownExtensibilityElement e = (UnknownExtensibilityElement) extElement;
        Element element = e.getElement();
        if (PolicyConstants.WS_POLICY_NAMESPACE_URI.equals(element
            .getNamespaceURI())
            && PolicyConstants.WS_POLICY.equals(element
                .getLocalName())) {
          policies.add(reader.readPolicy(element));

        } else if (PolicyConstants.WS_POLICY_NAMESPACE_URI
            .equals(element.getNamespaceURI())
            && PolicyConstants.WS_POLICY_REFERENCE.equals(element
                .getLocalName())) {

          try {
            policies.add(reader.readPolicyReference(element));

          } catch (Exception ex) {
            logger
                .debug("Exception occured when processing policy elements");
            throw new DeploymentException(ex.getMessage());
View Full Code Here

            // The root virtual file is the uniform way to obtain resources
            // 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))
            {
View Full Code Here

   }

   public void processPolicyExtensions(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions)
   {
      //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 void processPolicies(List<WSDLExtensibilityElement> policyReferences, PolicyScopeLevel scope, PolicyRegistry localPolicies, ExtensibleMetaData extMetaData)
   {
      if (policyReferences != null && policyReferences.size() != 0)
      {
         DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
         for (WSDLExtensibilityElement element : policyReferences)
         {
            PolicyReference policyRef = reader.readPolicyReference(element.getElement());
            deployPolicy(resolvePolicyReference(policyRef, localPolicies), scope, extMetaData);
         }
      }
   }
View Full Code Here

            // The root virtual file is the uniform way to obtain resources
            // 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))
            {
View Full Code Here

   }

   public void processPolicyExtensions(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions)
   {
      //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 void processPolicies(List<WSDLExtensibilityElement> policyReferences, PolicyScopeLevel scope, PolicyRegistry localPolicies, ExtensibleMetaData extMetaData)
   {
      if (policyReferences != null && policyReferences.size() != 0)
      {
         DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
         for (WSDLExtensibilityElement element : policyReferences)
         {
            PolicyReference policyRef = reader.readPolicyReference(element.getElement());
            deployPolicy(resolvePolicyReference(policyRef, localPolicies), scope, extMetaData);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.policy.util.DOMPolicyReader

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.