Author: asankha
Date: Mon May 21 05:16:40 2007
New Revision: 540128
URL: http://svn.apache.org/viewvc?view=rev&rev=540128
Log:
fix to be uptodate with the latest sandesha2 changes
fixed sandesha2 mar file name copied into sample repo
added support for the RequestResponseTransport interface
updated client to leave some delay when using -Dwsrm to allow time to cleanly
terminate sandesha2
added a dependency for wss4j as rampart seems to have removed it from its
latest pom
Added:
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
Modified:
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerWorker.java
webservices/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/StockQuoteClient.java
webservices/synapse/trunk/java/pom.xml
webservices/synapse/trunk/java/src/main/assembly/bin.xml
Added:
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java?view=auto&rev=540128
==============================================================================
---
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
(added)
+++
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
Mon May 21 05:16:40 2007
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.transport.nhttp;
+
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.transport.RequestResponseTransport;
+
+/**
+ * This interface is a point of control for Axis2 (and Sandesha2 in
particular) to control
+ * the behaviour of a Request-Response transport such as HTTP/s
+ *
+ * For nhttp, this does not make much of a difference, as we are capable of
keeping a socket open
+ * and writing to it from a different thread, while letting the initial thread
that read the request
+ * go free. However, it seems like Sandesha2 is looking for this interface,
and it is not going to
+ * create much of an issue anyway
+ */
+public class HttpCoreRequestResponseTransport implements
RequestResponseTransport {
+
+ private static final Log log =
LogFactory.getLog(HttpCoreRequestResponseTransport.class);
+ private RequestResponseTransportStatus status =
RequestResponseTransportStatus.INITIAL;
+ private MessageContext msgContext = null;
+
+ HttpCoreRequestResponseTransport(MessageContext msgContext) {
+ this.msgContext = msgContext;
+ }
+
+ public void acknowledgeMessage(MessageContext msgContext) throws AxisFault
{
+ log.debug("Acking one-way request");
+ }
+
+ public void awaitResponse() throws InterruptedException, AxisFault {
+ log.debug("Returning thread but keeping socket open -- awaiting
response");
+ status = RequestResponseTransportStatus.WAITING;
+
msgContext.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN,
"SKIP");
+ }
+
+ public void signalResponseReady() {
+ log.debug("Signal response available");
+ status = RequestResponseTransportStatus.SIGNALLED;
+ }
+
+ public RequestResponseTransportStatus getStatus() {
+ return status;
+ }
+
+ public void signalFaultReady(AxisFault fault) {
+ }
+}
Modified:
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerWorker.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerWorker.java?view=diff&rev=540128&r1=540127&r2=540128
==============================================================================
---
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerWorker.java
(original)
+++
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerWorker.java
Mon May 21 05:16:40 2007
@@ -27,6 +27,7 @@
import org.apache.axis2.context.OperationContext;
import org.apache.axis2.transport.http.HTTPTransportUtils;
import org.apache.axis2.transport.http.HTTPTransportReceiver;
+import org.apache.axis2.transport.RequestResponseTransport;
import org.apache.axiom.om.util.UUIDGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -152,6 +153,9 @@
}
}
+ // this is required to support Sandesha 2
+ msgContext.setProperty(RequestResponseTransport.TRANSPORT_CONTROL,
+ new HttpCoreRequestResponseTransport(msgContext));
return msgContext;
}
Modified:
webservices/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/StockQuoteClient.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/StockQuoteClient.java?view=diff&rev=540128&r1=540127&r2=540128
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/StockQuoteClient.java
(original)
+++
webservices/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/StockQuoteClient.java
Mon May 21 05:16:40 2007
@@ -32,6 +32,8 @@
import org.apache.rampart.RampartMessageData;
import org.apache.neethi.PolicyEngine;
import org.apache.neethi.Policy;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.synapse.util.UUIDGenerator;
import samples.common.StockQuoteHandler;
import java.net.URL;
@@ -137,6 +139,7 @@
System.out.println("Using WS-RM");
serviceClient.engageModule("sandesha2");
options.setProperty("Sandesha2LastMessage", "true");
+
options.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,
UUIDGenerator.getUUID());
}
serviceClient.setOptions(options);
@@ -149,6 +152,12 @@
} else {
OMElement result = serviceClient.sendReceive(payload);
+
+ if (Boolean.parseBoolean(wsrm)) {
+ // give some time for RM to terminate normally
+ Thread.sleep(5000);
+ }
+
if("customquote".equals(mode)) {
System.out.println("Custom :: Stock price = $" +
StockQuoteHandler.parseCustomQuoteResponse(result));
Modified: webservices/synapse/trunk/java/pom.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/pom.xml?view=diff&rev=540128&r1=540127&r2=540128
==============================================================================
--- webservices/synapse/trunk/java/pom.xml (original)
+++ webservices/synapse/trunk/java/pom.xml Mon May 21 05:16:40 2007
@@ -299,6 +299,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.sandesha2</groupId>
+ <artifactId>sandesha2-core</artifactId>
+ <version>${sandesha2.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>jakarta-httpcore</artifactId>
<version>${jakarta.httpcore.nio.version}</version>
@@ -416,6 +422,10 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.apache.ws.security</groupId>
+ <artifactId>wss4j</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart</artifactId>
<version>${rampart.version}</version>
@@ -428,6 +438,33 @@
<artifactId>sandesha2</artifactId>
<version>${sandesha2.version}</version>
<type>mar</type>
+ <exclusions>
+ <exclusion>
+ <groupId>httpcomponents-httpcore</groupId>
+ <artifactId>jakarta-httpcore</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-security</groupId>
+ <artifactId>xmlsec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sandesha2</groupId>
+ <artifactId>sandesha2-core</artifactId>
+ <version>${sandesha2.version}</version>
<exclusions>
<exclusion>
<groupId>httpcomponents-httpcore</groupId>
Modified: webservices/synapse/trunk/java/src/main/assembly/bin.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/assembly/bin.xml?view=diff&rev=540128&r1=540127&r2=540128
==============================================================================
--- webservices/synapse/trunk/java/src/main/assembly/bin.xml (original)
+++ webservices/synapse/trunk/java/src/main/assembly/bin.xml Mon May 21
05:16:40 2007
@@ -241,7 +241,7 @@
<includes>
<include>org.apache.axis2:addressing:mar</include>
<include>org.apache.rampart:rampart:mar</include>
- <include>org.apache.sandesha2:sandesha2-mar:mar</include>
+ <include>org.apache.sandesha2:sandesha2:mar</include>
</includes>
<outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
</dependencySet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]