Author: azeez
Date: Wed Jan 16 08:40:33 2008
New Revision: 12357
Log:
Merging the changes in the trunk
Modified:
branches/wsas/java/2.2/commons/deployers/axis1deployer/pom.xml
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1Deployer.java
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1InOutMessageReceiver.java
Modified: branches/wsas/java/2.2/commons/deployers/axis1deployer/pom.xml
==============================================================================
--- branches/wsas/java/2.2/commons/deployers/axis1deployer/pom.xml
(original)
+++ branches/wsas/java/2.2/commons/deployers/axis1deployer/pom.xml Wed Jan
16 08:40:33 2008
@@ -294,8 +294,8 @@
</distributionManagement>
<properties>
- <axis2.version>1.35</axis2.version>
- <axiom.version>1.2.6</axiom.version>
+ <axis2.version>SNAPSHOT</axis2.version>
+ <axiom.version>SNAPSHOT</axiom.version>
<axis1.version>1.4</axis1.version>
<log4j.version>1.2.13</log4j.version>
<commons.logging.version>1.1</commons.logging.version>
Modified:
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1Deployer.java
==============================================================================
---
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1Deployer.java
(original)
+++
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1Deployer.java
Wed Jan 16 08:40:33 2008
@@ -3,6 +3,7 @@
import org.apache.axis.ConfigurationException;
import org.apache.axis.MessageContext;
import org.apache.axis.configuration.FileProvider;
+import org.apache.axis.deployment.wsdd.WSDDService;
import org.apache.axis.description.ServiceDesc;
import org.apache.axis.server.AxisServer;
import org.apache.axis.utils.DOM2Writer;
@@ -32,6 +33,8 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.MalformedURLException;
+import java.util.Enumeration;
+import java.util.Hashtable;
import java.util.Iterator;
/*
@@ -51,16 +54,28 @@
*/
/**
- * This is a Deployer which adapts Axis1 services to Axis2. It works by
- * embedding an instance of Axis1's AxisEngine, and building proxy Axis2
- * services for each Axis1 service in a WSDD file. Each of those Axis2
- * services uses the Axis1InOutMessageReceiver, which handles the runtime
- * work of pulling in a message from Axis2 (after any Modules have run)
- * and pushing it into Axis1 via the Local transport.
+ * This is a Deployer which adapts Axis1 services to Axis2. It works by
embedding an instance of
+ * Axis1's AxisEngine, and building proxy Axis2 services for each Axis1
service in a WSDD file. Each
+ * of those Axis2 services uses the Axis1InOutMessageReceiver, which handles
the runtime work of
+ * pulling in a message from Axis2 (after any Modules have run) and pushing it
into Axis1 via the
+ * Local transport.
* <p/>
* Please contact Glen Daniels ([EMAIL PROTECTED]) for any questions.
*/
public class Axis1Deployer implements Deployer {
+
+ public class Axis1ParameterObserver implements ParameterObserver {
+ ServiceDesc serviceDesc;
+
+ public Axis1ParameterObserver(ServiceDesc serviceDesc) {
+ this.serviceDesc = serviceDesc;
+ }
+
+ public void parameterChanged(String name, Object value) {
+ serviceDesc.setProperty(name, value);
+ }
+ }
+
protected static final Log log = LogFactory.getLog(Axis1Deployer.class);
public static class A1WSDLSupplier implements WSDLSupplier {
@@ -123,12 +138,14 @@
FileProvider config = new
FileProvider(deploymentFileData.getAbsolutePath());
AxisServer server = new AxisServer(config);
WSDLSupplier supplier = new A1WSDLSupplier(server);
-
- Iterator services = config.getDeployedServices();
+
+ config.getDeployedServices(); // ensure everything's set up
+
+ WSDDService[] services = config.getDeployment().getServices();
AxisServiceGroup serviceGroup = new AxisServiceGroup();
serviceGroup.addParameter("service.axis1.server", server);
- while (services.hasNext()) {
- ServiceDesc service = (ServiceDesc) services.next();
+ for (int i = 0; i < services.length; i++) {
+ ServiceDesc service = services[i].getServiceDesc();
log.info("Deploying Axis1 service -- " + service.getName());
AxisService axisService;
@@ -157,7 +174,7 @@
service.setDefaultNamespace(null);
}
log.info("Couldn't process WSDL for Axis1 service '" +
serviceName +
- "', defaulting to passthrough mode.");
+ "', defaulting to passthrough mode.");
// Couldn't process WSDL (RPC/enc?), so set up passthrough
axisService = new AxisService(serviceName);
@@ -168,17 +185,25 @@
AxisOperation op = new InOutAxisOperation(new
QName("invokeAxis1Service"));
op.setDocumentation("This operation is a 'passthrough' for
all operations in " +
- "an RPC/encoded Axis1 service.");
+ "an RPC/encoded Axis1 service.");
axisService.addOperation(op);
}
axisService.setName(service.getName());
axisService.setClassLoader(classLoader);
+ // Put all the parameters from the A1 service into the A2
service
+ Hashtable params = services[i].getParametersTable();
+ Enumeration paramKeys = params.keys();
+ while (paramKeys.hasMoreElements()) {
+ String key = (String)paramKeys.nextElement();
+ axisService.addParameter(key, params.get(key));
+ }
+
Axis1InOutMessageReceiver receiver = new
Axis1InOutMessageReceiver();
AxisConfiguration axisConfig =
configCtx.getAxisConfiguration();
PhasesInfo phaseInfo = axisConfig.getPhasesInfo();
- for (Iterator i = axisService.getOperations(); i.hasNext();) {
- AxisOperation op = (AxisOperation)i.next();
+ for (Iterator ops = axisService.getOperations();
ops.hasNext();) {
+ AxisOperation op = (AxisOperation)ops.next();
op.setMessageReceiver(receiver);
phaseInfo.setOperationPhases(op);
}
@@ -188,6 +213,7 @@
// Add service type
axisService.addParameter("serviceType", "axis1_service");
axisService.setFileName(deploymentFileData.getFile().toURL());
+ axisService.addParameterObserver(new
Axis1ParameterObserver(service));
serviceGroup.addService(axisService);
}
serviceGroup.setServiceGroupName(deploymentFileData.getName());
@@ -204,8 +230,8 @@
throw new DeploymentException(e);
} catch (MalformedURLException e) {
throw new DeploymentException(e);
- } finally{
- if (threadClassLoader != null) {
+ } finally {
+ if (threadClassLoader != null) {
Thread.currentThread().setContextClassLoader(threadClassLoader);
}
}
@@ -227,7 +253,7 @@
axisConfig.removeServiceGroup(fileName);
configCtx.removeServiceGroupContext(asg);
log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED,
- fileName));
+ fileName));
} else {
axisConfig.removeFaultyService(fileName);
}
Modified:
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1InOutMessageReceiver.java
==============================================================================
---
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1InOutMessageReceiver.java
(original)
+++
branches/wsas/java/2.2/commons/deployers/axis1deployer/src/main/java/a1deployer/Axis1InOutMessageReceiver.java
Wed Jan 16 08:40:33 2008
@@ -107,6 +107,13 @@
outMessage.setEnvelope(builder.getSOAPEnvelope());
}
+ /**
+ * Translate an Axis1.X fault into an Axis2 fault by serializing /
deserializing
+ *
+ * @param fault Axis1 fault
+ * @return an Axis2 fault
+ * @noinspection ThrowableInstanceNeverThrown
+ */
public static AxisFault translateFault(org.apache.axis.AxisFault fault) {
try {
org.apache.axis.Message msg = new Message(fault);
_______________________________________________
Wsas-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev