cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1544449 - /cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Date Fri, 22 Nov 2013 09:32:13 GMT
Author: ay
Date: Fri Nov 22 09:32:13 2013
New Revision: 1544449

URL: http://svn.apache.org/r1544449
Log:
[CXF-5409] Make response code be included in logging for LocalTransport

Modified:
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=1544449&r1=1544448&r2=1544449&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Fri Nov 22 09:32:13 2013
@@ -34,6 +34,7 @@ import org.apache.cxf.io.CachedOutputStr
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.AbstractConduit;
 import org.apache.cxf.transport.AbstractDestination;
@@ -159,6 +160,13 @@ public class LocalDestination extends Ab
 
         @Override
         public void close(Message message) throws IOException {
+            // set the pseudo status code if not set (REVISIT add this method in MessageUtils
to be reused elsewhere?)
+            Integer i = (Integer)message.get(Message.RESPONSE_CODE);
+            if (i == null) {
+                int code = ((message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message))

+                    || MessageUtils.isEmptyPartialResponse(message)) ? 202 : 200;
+                message.put(Message.RESPONSE_CODE, code);
+            }
             if (Boolean.TRUE.equals(message.getExchange().get(LocalConduit.DIRECT_DISPATCH)))
{
                 final Exchange exchange = (Exchange)message.getExchange().get(LocalConduit.IN_EXCHANGE);
                 



Mime
View raw message