diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-31 15:58:21 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-31 15:58:21 +0000 |
commit | 1fa5bfcc26e5cb3d1b2c012dbeac1514c60e7888 (patch) | |
tree | b187069ffb11c310bf3f88370168004e2b084253 /branches/sca-equinox/modules | |
parent | c4d844839ca7ff6e024d7748264dc6efa9a27e1b (diff) |
Remove dependency on assembly-xml
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@709451 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
9 files changed, 19 insertions, 35 deletions
diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java index 2b7d753023..5aaea5a7a8 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicy.java @@ -20,7 +20,6 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic; import javax.xml.namespace.QName; -import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.policy.Policy; /** @@ -30,7 +29,8 @@ import org.apache.tuscany.sca.policy.Policy; * @version $Rev$ $Date$ */ public class Axis2BasicAuthenticationPolicy implements Policy { - public static final QName AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "axis2BasicAuthentication"); + private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; + public static final QName AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2BasicAuthentication"); public static final String AXIS2_BASIC_AUTHENTICATION_USERNAME = "username"; public static final String AXIS2_BASIC_AUTHENTICATION_PASSWORD = "password"; public static final String AXIS2_BASIC_AUTHENTICATION_HTTP_HEADER = "httpheader"; diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java index b4be2f9c00..1856830e49 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationPolicyProcessor.java @@ -20,13 +20,15 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic; import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; +import static org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_PASSWORD; +import static org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME; +import static org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_USERNAME; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; @@ -61,9 +63,9 @@ public class Axis2BasicAuthenticationPolicyProcessor implements StAXArtifactProc name = reader.getName(); if ( name.equals(getArtifactType()) ) { // no attributes at the moment - } else if ( Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_USERNAME.equals(name.getLocalPart()) ) { + } else if ( AXIS2_BASIC_AUTHENTICATION_USERNAME.equals(name.getLocalPart()) ) { policy.setUserName(reader.getElementText()); - } else if ( Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_PASSWORD.equals(name.getLocalPart()) ) { + } else if ( AXIS2_BASIC_AUTHENTICATION_PASSWORD.equals(name.getLocalPart()) ) { policy.setPassword(reader.getElementText()); } break; @@ -91,11 +93,11 @@ public class Axis2BasicAuthenticationPolicyProcessor implements StAXArtifactProc writer.writeStartElement(prefix, getArtifactType().getLocalPart(), getArtifactType().getNamespaceURI()); - writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS); + writer.writeNamespace("tuscany", AXIS2_BASIC_AUTHENTICATION_POLICY_QNAME.getNamespaceURI()); if ( policy.getUserName() != null ) { writer.writeStartElement(prefix, - Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_USERNAME, + AXIS2_BASIC_AUTHENTICATION_USERNAME, getArtifactType().getNamespaceURI()); writer.writeCharacters(policy.getUserName()); writer.writeEndElement(); @@ -103,7 +105,7 @@ public class Axis2BasicAuthenticationPolicyProcessor implements StAXArtifactProc if ( policy.getPassword() != null ) { writer.writeStartElement(prefix, - Axis2BasicAuthenticationPolicy.AXIS2_BASIC_AUTHENTICATION_PASSWORD, + AXIS2_BASIC_AUTHENTICATION_PASSWORD, getArtifactType().getNamespaceURI()); writer.writeCharacters(policy.getPassword()); writer.writeEndElement(); diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java index 6bd1eed1bd..c6344bbcbd 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyInterceptor.java @@ -18,19 +18,12 @@ */ package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic; -import java.util.logging.ConsoleHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; - import javax.xml.namespace.QName; -import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Interceptor; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.policy.Policy; import org.apache.tuscany.sca.policy.PolicySet; /** @@ -40,7 +33,8 @@ import org.apache.tuscany.sca.policy.PolicySet; * @version $Rev$ $Date$ */ public class Axis2BasicAuthenticationReferencePolicyInterceptor implements Interceptor { - public static final QName policySetQName = new QName(Constants.SCA10_TUSCANY_NS, "wsBasicAuthentication"); + private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; + public static final QName policySetQName = new QName(SCA10_TUSCANY_NS, "wsBasicAuthentication"); private Invoker next; private Operation operation; diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java index 530d99c01e..b6def7af1f 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationReferencePolicyProvider.java @@ -27,7 +27,6 @@ import org.apache.tuscany.sca.invocation.Interceptor; import org.apache.tuscany.sca.invocation.Phase; import org.apache.tuscany.sca.policy.PolicySet; import org.apache.tuscany.sca.policy.PolicySetAttachPoint; -import org.apache.tuscany.sca.policy.util.PolicyHandler; import org.apache.tuscany.sca.provider.PolicyProvider; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java index f2964650ef..f6c8d072a4 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyInterceptor.java @@ -18,21 +18,12 @@ */ package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic; -import java.util.Map; -import java.util.logging.ConsoleHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; - import javax.xml.namespace.QName; -import org.apache.axiom.om.util.Base64; -import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Interceptor; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.policy.Policy; import org.apache.tuscany.sca.policy.PolicySet; /** @@ -42,7 +33,8 @@ import org.apache.tuscany.sca.policy.PolicySet; * @version $Rev$ $Date$ */ public class Axis2BasicAuthenticationServicePolicyInterceptor implements Interceptor { - public static final QName policySetQName = new QName(Constants.SCA10_TUSCANY_NS, "wsBasicAuthentication"); + private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; + public static final QName policySetQName = new QName(SCA10_TUSCANY_NS, "wsBasicAuthentication"); private Invoker next; private Operation operation; diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java index 9c1a9704d3..35504fddec 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/basic/Axis2BasicAuthenticationServicePolicyProvider.java @@ -27,7 +27,6 @@ import org.apache.tuscany.sca.invocation.Interceptor; import org.apache.tuscany.sca.invocation.Phase; import org.apache.tuscany.sca.policy.PolicySet; import org.apache.tuscany.sca.policy.PolicySetAttachPoint; -import org.apache.tuscany.sca.policy.util.PolicyHandler; import org.apache.tuscany.sca.provider.PolicyProvider; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentService; diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java index 8d08a3f78e..fa26fedc9e 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java @@ -24,7 +24,6 @@ import java.util.Map; import javax.xml.namespace.QName; import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.policy.Policy; /** @@ -34,7 +33,8 @@ import org.apache.tuscany.sca.policy.Policy; * @version $Rev$ $Date$ */ public class Axis2ConfigParamPolicy implements Policy { - public static final QName NAME = new QName(Constants.SCA10_TUSCANY_NS, "wsConfigParam"); + private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; + public static final QName NAME = new QName(SCA10_TUSCANY_NS, "wsConfigParam"); private Map<String, OMElement> paramElements = new Hashtable<String, OMElement>(); public Map<String, OMElement> getParamElements() { diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java index 158c86f07b..33a1688138 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java @@ -30,7 +30,6 @@ import javax.xml.stream.XMLStreamWriter; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; -import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; @@ -65,7 +64,7 @@ public class Axis2ConfigParamPolicyProcessor implements StAXArtifactProcessor<Ax case START_ELEMENT : { name = reader.getName(); if ( PARAMETER.equals(name.getLocalPart()) ) { - paramName = reader.getAttributeValue(null, Constants.NAME); + paramName = reader.getAttributeValue(null, "name"); parameterElement = loadElement(reader); policy.getParamElements().put(paramName, parameterElement); } diff --git a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java index cf14e54b5f..44533fe0b6 100644 --- a/branches/sca-equinox/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java +++ b/branches/sca-equinox/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java @@ -25,15 +25,14 @@ import java.net.URL; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamReader; -import org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy; +import junit.framework.TestCase; + import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import junit.framework.TestCase; - /** * * Test the reading of ws config params policy. |