You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2007/09/13 17:12:27 UTC
svn commit: r575329 - in
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport:
RequestResponseTransport.java http/AxisServlet.java http/HTTPWorker.java
http/server/AxisHttpService.java nhttp/HttpCoreRequestResponseTransport.java
Author: scheu
Date: Thu Sep 13 08:12:26 2007
New Revision: 575329
URL: http://svn.apache.org/viewvc?rev=575329&view=rev
Log:
AXIS2-3200
Contributor:Bill Nagy
Allow the RequestResponseTransport to be used to check whether or not a response should been written or acked, so that RM can notify the transport that an actual response has been written, and the transport can send back the correct status code.
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java?rev=575329&r1=575328&r2=575329&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java Thu Sep 13 08:12:26 2007
@@ -112,10 +112,15 @@
new RequestResponseTransportStatus(2);
/**
+ * acknowledgeMessage has been called.
+ */
+ public static RequestResponseTransportStatus ACKED =
+ new RequestResponseTransportStatus (3);
+ /**
* 'signalResponseReady' has been called.
*/
public static RequestResponseTransportStatus SIGNALLED =
- new RequestResponseTransportStatus(3);
+ new RequestResponseTransportStatus(4);
private int value;
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?rev=575329&r1=575328&r2=575329&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java Thu Sep 13 08:12:26 2007
@@ -49,6 +49,7 @@
import org.apache.axis2.transport.RequestResponseTransport;
import org.apache.axis2.transport.TransportListener;
import org.apache.axis2.transport.TransportUtils;
+import org.apache.axis2.transport.RequestResponseTransport.RequestResponseTransportStatus;
import org.apache.axis2.transport.http.server.HttpUtils;
import org.apache.axis2.transport.http.util.RESTUtil;
import org.apache.axis2.util.JavaUtils;
@@ -713,7 +714,8 @@
throw new AxisFault("Error sending acknowledgement", e);
}
- signalResponseReady();
+ status = RequestResponseTransportStatus.ACKED;
+ responseReadySignal.countDown();
}
public void awaitResponse()
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=575329&r1=575328&r2=575329&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java Thu Sep 13 08:12:26 2007
@@ -301,11 +301,16 @@
// Finalize response
OperationContext operationContext = msgContext.getOperationContext();
Object isTwoChannel = null;
+ RequestResponseTransport requestResponseTransportControl =
+ (RequestResponseTransport)msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
if (operationContext != null) {
isTwoChannel = operationContext.getProperty(Constants.DIFFERENT_EPR);
}
- if (TransportUtils.isResponseWritten(msgContext)) {
+ if (TransportUtils.isResponseWritten(msgContext) ||
+ ((requestResponseTransportControl != null) &&
+ requestResponseTransportControl.getStatus().
+ equals(RequestResponseTransport.RequestResponseTransportStatus.SIGNALLED))) {
if ((isTwoChannel != null) && Constants.VALUE_TRUE.equals(isTwoChannel)) {
response.setStatus(HttpStatus.SC_ACCEPTED);
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java?rev=575329&r1=575328&r2=575329&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java Thu Sep 13 08:12:26 2007
@@ -29,6 +29,7 @@
import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.engine.AxisEngine;
import org.apache.axis2.transport.RequestResponseTransport;
+import org.apache.axis2.transport.RequestResponseTransport.RequestResponseTransportStatus;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.util.MessageContextBuilder;
import org.apache.commons.logging.Log;
@@ -318,7 +319,8 @@
public void acknowledgeMessage(MessageContext msgContext) throws AxisFault {
//TODO: Once the core HTTP API allows us to return an ack before unwinding, then the should be fixed
- signalResponseReady();
+ status = RequestResponseTransportStatus.ACKED;
+ responseReadySignal.countDown();
}
public void awaitResponse() throws InterruptedException, AxisFault {
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java?rev=575329&r1=575328&r2=575329&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java Thu Sep 13 08:12:26 2007
@@ -25,6 +25,7 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.transport.RequestResponseTransport;
+import org.apache.axis2.transport.RequestResponseTransport.RequestResponseTransportStatus;
/**
* This interface is a point of control for Axis2 (and Sandesha2 in particular) to control
@@ -48,6 +49,7 @@
public void acknowledgeMessage(MessageContext msgContext) throws AxisFault {
log.debug("Acking one-way request");
+ status = RequestResponseTransportStatus.ACKED;
}
public void awaitResponse() throws InterruptedException, AxisFault {
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org