diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-09 00:39:28 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-09 00:39:28 +0000 |
commit | 5b3e09d2a66139f32d9808080a2bbd4d1c90f0fa (patch) | |
tree | 94d9085a658c155ece20b3719710c3bdbfa56a41 /java/sca | |
parent | 16d0630f33776aeade8a29c383caca55b9d65ac5 (diff) |
Fix OSGi access violations and package imports
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@724568 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
20 files changed, 189 insertions, 98 deletions
diff --git a/java/sca/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF b/java/sca/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF index 24f0f4f117..debe32f645 100644 --- a/java/sca/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF +++ b/java/sca/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF @@ -1,18 +1,24 @@ Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.ws.axis2.policy.configu
- ration;uses:="org.apache.axis2,org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.provider,
- org.apache.tuscany.sca.core,org.apache.axis2.context,
- org.apache.tuscany.sca.monitor,
- org.apache.tuscany.sca.policy,
- javax.xml.namespace,org.apache.axiom.om,
- org.apache.axis2.description,javax.xml.stream,
- org.apache.axis2.engine,
- org.apache.tuscany.sca.contribution.resolver,
- org.apache.tuscany.sca.policy.util,
- org.apache.tuscany.sca.contribution.processor,
- org.osoa.sca";version="1.4"
+Export-Package: org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;version="1.4.0",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version="1.4";
+ uses:="org.apache.axis2,
+ org.apache.tuscany.sca.runtime,
+ org.apache.tuscany.sca.assembly,
+ org.apache.tuscany.sca.provider,
+ org.apache.tuscany.sca.core,
+ org.apache.axis2.context,
+ org.apache.tuscany.sca.monitor,
+ org.apache.tuscany.sca.policy,
+ javax.xml.namespace,
+ org.apache.axiom.om,
+ org.apache.axis2.description,
+ javax.xml.stream,
+ org.apache.axis2.engine,
+ org.apache.tuscany.sca.contribution.resolver,
+ org.apache.tuscany.sca.policy.util,
+ org.apache.tuscany.sca.contribution.processor,
+ org.osoa.sca",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.header;version="1.4.0"
Tool: Bnd-0.0.255
Bundle-Name: Apache Tuscany Policy Model for Axis2 WS binding
Created-By: 1.6.0_07 (Sun Microsystems Inc.)
@@ -25,15 +31,16 @@ Bundle-Description: Apache Tuscany Policy Model for Axis2 WS binding Import-Package: javax.xml.namespace,
javax.xml.stream;version="1.0",
org.apache.axiom.om,
+ org.apache.axiom.soap,
org.apache.axis2,
org.apache.axis2.context,
org.apache.axis2.description,
org.apache.axis2.engine,
org.apache.tuscany.sca.assembly;version="1.4",
- org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic;v
- ersion="1.4",
- org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version=
- "1.4",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic;version="1.4",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;version="1.4.0",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version="1.4",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.header;version="1.4.0",
org.apache.tuscany.sca.contribution.processor;version="1.4",
org.apache.tuscany.sca.contribution.resolver;version="1.4",
org.apache.tuscany.sca.core;version="1.4",
@@ -41,6 +48,8 @@ Import-Package: javax.xml.namespace, org.apache.tuscany.sca.invocation;version="1.4",
org.apache.tuscany.sca.monitor;version="1.4",
org.apache.tuscany.sca.policy;version="1.4",
+ org.apache.tuscany.sca.policy.authentication.token;version="1.4.0",
+ org.apache.tuscany.sca.policy.security;version="1.4.0",
org.apache.tuscany.sca.policy.util;version="1.4",
org.apache.tuscany.sca.provider;version="1.4",
org.apache.tuscany.sca.runtime;version="1.4",
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java index c0ef6297a1..004d52be9c 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java @@ -20,7 +20,6 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token; 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: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
*/
public class Axis2TokenAuthenticationPolicy implements Policy {
- public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "axis2TokenAuthentication");
+ private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
+ public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2TokenAuthentication");
public static final String AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME = "tokenName";
private QName tokenName;
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java index 6cc55255d0..7dde20af87 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java @@ -26,14 +26,13 @@ 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.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.monitor.Monitor;
/**
@@ -42,6 +41,7 @@ import org.apache.tuscany.sca.monitor.Monitor; * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
*/
public class Axis2TokenAuthenticationPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Axis2TokenAuthenticationPolicy> {
+ private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
public QName getArtifactType() {
return Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME;
@@ -89,7 +89,7 @@ public class Axis2TokenAuthenticationPolicyProcessor extends BaseStAXArtifactPro writer.writeStartElement(prefix,
getArtifactType().getLocalPart(),
getArtifactType().getNamespaceURI());
- writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS);
+ writer.writeNamespace("tuscany", SCA10_TUSCANY_NS);
if ( policy.getTokenName() != null ) {
writer.writeStartElement(prefix,
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java index cc6708d6fa..41682c29b1 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java @@ -18,27 +18,11 @@ */
package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-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.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString;
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;
/**
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java index c9833016f0..ed5ab90eb9 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java @@ -31,7 +31,7 @@ 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.PolicySet;
-import org.apache.tuscany.sca.policy.SecurityUtil;
+import org.apache.tuscany.sca.policy.security.SecurityUtil;
import org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal;
/**
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java index 8d08a3f78e..fa26fedc9e 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java +++ b/java/sca/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/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java index 59b103809d..33a1688138 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java @@ -30,8 +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; @@ -66,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/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java index 244e501901..0c9cf76a29 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java @@ -20,7 +20,6 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; 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 Axis2HeaderPolicy implements Policy { - public static final QName AXIS2_HEADER_POLICY_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "axis2Header"); + private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; + public static final QName AXIS2_HEADER_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2Header"); public static final String AXIS2_HEADER_NAME = "headerName"; private QName headerName; diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java index c5c4b673bf..b6962ff243 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java @@ -21,21 +21,18 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; -import java.util.logging.Level; - 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.core.FactoryExtensionPoint; import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; +import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; +import org.apache.tuscany.sca.contribution.resolver.ModelResolver; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.monitor.Monitor; /** @@ -43,6 +40,7 @@ import org.apache.tuscany.sca.monitor.Monitor; * @version $Rev$ $Date$ */ public class Axis2HeaderPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Axis2HeaderPolicy> { + private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; public QName getArtifactType() { return Axis2HeaderPolicy.AXIS2_HEADER_POLICY_QNAME; @@ -90,7 +88,7 @@ public class Axis2HeaderPolicyProcessor extends BaseStAXArtifactProcessor implem writer.writeStartElement(prefix, getArtifactType().getLocalPart(), getArtifactType().getNamespaceURI()); - writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS); + writer.writeNamespace("tuscany", SCA10_TUSCANY_NS); if ( policy.getHeaderName() != null ) { writer.writeStartElement(prefix, diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java index 1b3315bb76..78adfae484 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java @@ -18,26 +18,10 @@ */ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; -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.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; -import org.apache.axiom.om.OMText; -import org.apache.axiom.om.impl.llom.util.AXIOMUtil; -import org.apache.axiom.soap.SOAPFactory; -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; /** diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java index a758ca5261..860678a4e4 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java @@ -19,10 +19,6 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMElement; -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; diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java index 7a1f26bf04..36916f4ff5 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java @@ -20,14 +20,10 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; import javax.xml.namespace.QName; -import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; -import org.apache.axiom.om.OMText; import org.apache.axiom.soap.SOAPFactory; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.policy.Policy; /** * Implementation for policies that could be injected as parameter diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java index 0eefeac87b..c593f07780 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java @@ -18,15 +18,9 @@ */ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; import org.apache.axiom.om.OMText; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.policy.Policy; /** * Implementation for policies that could be injected as parameter diff --git a/java/sca/modules/binding-ws-axis2/META-INF/MANIFEST.MF b/java/sca/modules/binding-ws-axis2/META-INF/MANIFEST.MF index 4ad0490a07..e5d96a19a2 100644 --- a/java/sca/modules/binding-ws-axis2/META-INF/MANIFEST.MF +++ b/java/sca/modules/binding-ws-axis2/META-INF/MANIFEST.MF @@ -82,6 +82,9 @@ Import-Package: javax.security.auth.callback;resolution:=optional, org.apache.tuscany.sca.assembly;version="1.4",
org.apache.tuscany.sca.binding.ws;version="1.4",
org.apache.tuscany.sca.binding.ws.axis2;version="1.4",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;version="1.4.0",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version="1.4.0",
+ org.apache.tuscany.sca.binding.ws.axis2.policy.header;version="1.4.0",
org.apache.tuscany.sca.contribution.processor;version="1.4",
org.apache.tuscany.sca.core;version="1.4",
org.apache.tuscany.sca.core.assembly;version="1.4",
@@ -95,6 +98,7 @@ Import-Package: javax.security.auth.callback;resolution:=optional, org.apache.tuscany.sca.invocation;version="1.4",
org.apache.tuscany.sca.policy;version="1.4",
org.apache.tuscany.sca.policy.authentication.basic;version="1.4",
+ org.apache.tuscany.sca.policy.security;version="1.4.0",
org.apache.tuscany.sca.policy.security.ws;version="1.4",
org.apache.tuscany.sca.policy.util;version="1.4",
org.apache.tuscany.sca.provider;version="1.4",
diff --git a/java/sca/modules/binding-ws-axis2/pom.xml b/java/sca/modules/binding-ws-axis2/pom.xml index 66383d91f1..35bc9972af 100644 --- a/java/sca/modules/binding-ws-axis2/pom.xml +++ b/java/sca/modules/binding-ws-axis2/pom.xml @@ -284,6 +284,13 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-launcher-equinox</artifactId> + <version>2.0-SNAPSHOT</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-java-runtime</artifactId> <version>2.0-SNAPSHOT</version> <scope>test</scope> diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java index 7c7491f331..c77adbb0c4 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java @@ -80,7 +80,7 @@ import org.apache.tuscany.sca.binding.ws.axis2.policy.configurator.Axis2BindingB import org.apache.tuscany.sca.binding.ws.axis2.policy.configurator.Axis2BindingHeaderConfigurator; import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicy; import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString; -import org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl; +import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl; import org.apache.tuscany.sca.host.http.ServletHost; import org.apache.tuscany.sca.interfacedef.Interface; import org.apache.tuscany.sca.interfacedef.Operation; diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java index bd154dbc67..853bfbc0cb 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java @@ -26,6 +26,8 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.util.HashMap; +import java.util.Iterator; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; @@ -41,7 +43,6 @@ import org.apache.axis2.description.Parameter; import org.apache.axis2.engine.AxisConfiguration; import org.apache.axis2.engine.AxisConfigurator; import org.apache.axis2.i18n.Messages; -import org.apache.axis2.util.Loader; /** * Helps configure Axis2 from a resource in binding.ws.axis2 instead of Axis2.xml @@ -89,6 +90,15 @@ public class TuscanyAxisConfigurator extends URLBasedAxisConfigurator implements return configContext; } + private InputStream getResourceAsStream(final String resource) { + return AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + public InputStream run() { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + return cl.getResourceAsStream(resource); + } + }); + } + /* these three methods are part of a temporary fix to solve problems that Maven has with including * rampart-1.3.mar into the classpath and also at the time of Release 1.0 rampart-1.3.mar seems * to pull in a SNAPSHOT version of rampart-project pom. Hence rampart.mar has been excluded @@ -101,7 +111,7 @@ public class TuscanyAxisConfigurator extends URLBasedAxisConfigurator implements try { if (axis2_xml == null) { axis2xmlStream = - Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE); + getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE); } else { axis2xmlStream = axis2_xml.openStream(); } @@ -157,8 +167,8 @@ public class TuscanyAxisConfigurator extends URLBasedAxisConfigurator implements module.setParent(axisConfig); //String moduleFile = fileUrl.substring(0, fileUrl.indexOf(".mar")); if (module.getName() == null) { - module.setName(org.apache.axis2.util.Utils.getModuleName("rampart-1.4")); - module.setVersion(org.apache.axis2.util.Utils.getModuleVersion("rampart-1.4")); + module.setName("rampart"); + module.setVersion("1.4"); } populateModule(module, rampart_mar_url); module.setFileName(rampart_mar_url); @@ -175,13 +185,126 @@ public class TuscanyAxisConfigurator extends URLBasedAxisConfigurator implements throw (AxisFault)e.getException(); } - org.apache.axis2.util.Utils. - calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig); + calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig); axisConfig.validateSystemPredefinedPhases(); } catch (IOException e) { throw new DeploymentException(e); } } + /** + * Get the name of the module , where archive name is combination of module name + its version + * The format of the name is as follows: + * moduleName-00.0000 + * Example: "addressing-01.0001.mar" would return "addressing" + * + * @param moduleName the name of the module archive + * @return the module name parsed out of the file name + */ + public static String getModuleName(String moduleName) { + if (moduleName.endsWith("-SNAPSHOT")) { + return moduleName.substring(0, moduleName.indexOf("-SNAPSHOT")); + } + char delimiter = '-'; + int version_index = moduleName.lastIndexOf(delimiter); + if (version_index > 0) { + String versionString = getModuleVersion(moduleName); + if (versionString == null) { + return moduleName; + } else { + return moduleName.substring(0, version_index); + } + } else { + return moduleName; + } + } + + public static String getModuleVersion(String moduleName) { + if (moduleName.endsWith("-SNAPSHOT")) { + return "SNAPSHOT"; + } + char version_seperator = '-'; + int version_index = moduleName.lastIndexOf(version_seperator); + if (version_index > 0) { + String versionString = moduleName.substring(version_index + 1, moduleName.length()); + try { + Float.parseFloat(versionString); + return versionString; + } catch (NumberFormatException e) { + return null; + } + } else { + return null; + } + } + + public static String getModuleName(String moduleName, String moduleVersion) { + if (moduleVersion != null && moduleVersion.length() != 0) { + moduleName = moduleName + "-" + moduleVersion; + } + return moduleName; + } + + public static boolean isLatest(String moduleVersion, String currentDefaultVersion) { + if (AxisModule.VERSION_SNAPSHOT.equals(moduleVersion)) { + return true; + } else { + float m_version = Float.parseFloat(moduleVersion); + float m_c_vresion = Float.parseFloat(currentDefaultVersion); + return m_version > m_c_vresion; + } + } + + public static void calculateDefaultModuleVersion(HashMap modules, + AxisConfiguration axisConfig) { + Iterator allModules = modules.values().iterator(); + HashMap defaultModules = new HashMap(); + while (allModules.hasNext()) { + AxisModule axisModule = (AxisModule) allModules.next(); + String moduleName = axisModule.getName(); + String moduleNameString; + String moduleVersionString; + if (AxisModule.VERSION_SNAPSHOT.equals(axisModule.getVersion())) { + moduleNameString = axisModule.getName(); + moduleVersionString = axisModule.getVersion(); + } else { + if (axisModule.getVersion() == null) { + moduleNameString = getModuleName(moduleName); + moduleVersionString = getModuleVersion(moduleName); + if (moduleVersionString != null) { + try { + Float.valueOf(moduleVersionString); + axisModule.setVersion(moduleVersionString); + axisModule.setName(moduleName); + } catch (NumberFormatException e) { + moduleVersionString = null; + } + } + } else { + moduleNameString = axisModule.getName(); + moduleVersionString = axisModule.getVersion(); + } + } + String currentDefaultVerison = (String) defaultModules.get(moduleNameString); + if (currentDefaultVerison != null) { + // if the module version is null then , that will be ignore in this case + if (!AxisModule.VERSION_SNAPSHOT.equals(currentDefaultVerison)) { + if (moduleVersionString != null && + isLatest(moduleVersionString, currentDefaultVerison)) { + defaultModules.put(moduleNameString, moduleVersionString); + } + } + } else { + defaultModules.put(moduleNameString, moduleVersionString); + } + + } + Iterator def_mod_itr = defaultModules.keySet().iterator(); + while (def_mod_itr.hasNext()) { + String moduleName = (String) def_mod_itr.next(); + axisConfig.addDefaultModuleVersion(moduleName, (String) defaultModules.get(moduleName)); + } + } + private void populateModule(AxisModule module, URL moduleUrl) throws DeploymentException { try { diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java index 34899a4af0..3527061a66 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java @@ -30,7 +30,6 @@ import org.apache.axis2.description.AxisService; import org.apache.axis2.description.HandlerDescription; import org.apache.axis2.engine.AxisConfiguration; import org.apache.axis2.engine.RequestURIBasedDispatcher; -import org.apache.axis2.util.JavaUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -86,7 +85,7 @@ public class TuscanyDispatcher extends RequestURIBasedDispatcher { if (services == null) { return null; } - String[] parts = JavaUtils.split(path, '/'); + String[] parts = path.split("/"); String serviceName = ""; for (int i=parts.length-1; i>=0; i--) { serviceName = parts[i] + serviceName; diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java index ce3a0c33fb..3f8599b118 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java @@ -39,7 +39,6 @@ import org.apache.axis2.description.AxisService; import org.apache.axis2.description.Parameter; import org.apache.axis2.transport.http.ListingAgent; import org.apache.axis2.transport.http.server.HttpUtils; -import org.apache.axis2.util.JavaUtils; import org.apache.ws.commons.schema.XmlSchema; import org.apache.ws.commons.schema.XmlSchemaExternal; @@ -160,7 +159,7 @@ public class TuscanyListingAgent extends ListingAgent { if (services == null) { return null; } - String[] parts = JavaUtils.split(path, '/'); + String[] parts = path.split("/"); String serviceName = ""; for (int i=parts.length-1; i>=0; i--) { serviceName = parts[i] + serviceName; diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java index 4c18c89353..c09e453065 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java @@ -32,7 +32,7 @@ import org.apache.axis2.transport.http.HTTPConstants; import org.apache.axis2.transport.http.HttpTransportProperties; import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator; import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.policy.SecurityUtil; +import org.apache.tuscany.sca.policy.security.SecurityUtil; import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy; import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPrincipal; import org.osoa.sca.ServiceRuntimeException; |