cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaypai...@apache.org
Subject svn commit: r505240 - in /incubator/cxf/trunk/rt/transports: http/src/main/java/org/apache/cxf/transport/http/ http/src/test/java/org/apache/cxf/transport/http/ http2/src/main/java/org/apache/cxf/transport/http/ http2/src/test/java/org/apache/cxf/trans...
Date Fri, 09 Feb 2007 10:21:26 GMT
Author: ajaypaibir
Date: Fri Feb  9 02:21:25 2007
New Revision: 505240

URL: http://svn.apache.org/viewvc?view=rev&rev=505240
Log:
CXF-415 Decoupled endpoint observer should not insert HttpRequest, HttpResponse instances
into Message Context

Modified:
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
    incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=505240&r1=505239&r2=505240
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Fri Feb  9 02:21:25 2007
@@ -65,7 +65,8 @@
  * HTTP Conduit implementation.
  */
 public class HTTPConduit extends AbstractConduit implements Configurable {
-    
+    public static final String HTTP_REQUEST = "org.apache.cxf.transport.http.JettyHTTPDestination.REQUEST";
+    public static final String HTTP_RESPONSE = "org.apache.cxf.transport.http.JettyHTTPDestination.RESPONSE";
     public static final String HTTP_CONNECTION = "http.connection";
     private static final Logger LOG = LogUtils.getL7dLogger(HTTPConduit.class);
     
@@ -674,6 +675,12 @@
             //inMessage.put(Message.PROTOCOL_HEADERS, req.getXXX());
             setHeaders(inMessage);
             inMessage.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);
+
+            // remove server-specific properties
+            inMessage.remove(HTTP_REQUEST);
+            inMessage.remove(HTTP_RESPONSE);
+            inMessage.remove(Message.ASYNC_POST_RESPONSE_DISPATCH);
+
             incomingObserver.onMessage(inMessage);
         }
     }

Modified: incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java?view=diff&rev=505240&r1=505239&r2=505240
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
Fri Feb  9 02:21:25 2007
@@ -388,6 +388,15 @@
         assertEquals("expected DECOUPLED_CHANNEL_MESSAGE flag set",
                      Boolean.TRUE,
                      inMessage.get(DECOUPLED_CHANNEL_MESSAGE));
+        assertEquals("unexpected HTTP_REQUEST set",
+                     false,
+                     inMessage.containsKey(HTTPConduit.HTTP_REQUEST));
+        assertEquals("unexpected HTTP_RESPONSE set",
+                     false,
+                     inMessage.containsKey(HTTPConduit.HTTP_RESPONSE));
+        assertEquals("unexpected Message.ASYNC_POST_RESPONSE_DISPATCH set",
+                     false,
+                     inMessage.containsKey(Message.ASYNC_POST_RESPONSE_DISPATCH));
     }
 
     private void finalVerify() {

Modified: incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=505240&r1=505239&r2=505240
==============================================================================
--- incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Fri Feb  9 02:21:25 2007
@@ -66,7 +66,8 @@
  * HTTP Conduit implementation.
  */
 public class HTTPConduit extends AbstractConduit {
-
+    public static final String HTTP_REQUEST = "org.apache.cxf.transport.http.JettyHTTPDestination.REQUEST";
+    public static final String HTTP_RESPONSE = "org.apache.cxf.transport.http.JettyHTTPDestination.RESPONSE";
     public static final String HTTP_CONNECTION = "http.connection";
     private static final Logger LOG = LogUtils.getL7dLogger(HTTPConduit.class);
     
@@ -644,6 +645,12 @@
             //inMessage.put(Message.PROTOCOL_HEADERS, req.getXXX());
             setHeaders(inMessage);
             inMessage.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);
+
+            // remove server-specific properties
+            inMessage.remove(HTTP_REQUEST);
+            inMessage.remove(HTTP_RESPONSE);
+            inMessage.remove(Message.ASYNC_POST_RESPONSE_DISPATCH);
+
             incomingObserver.onMessage(inMessage);
         }
     }

Modified: incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java?view=diff&rev=505240&r1=505239&r2=505240
==============================================================================
--- incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/HTTPConduitTest.java
Fri Feb  9 02:21:25 2007
@@ -394,6 +394,15 @@
         assertEquals("expected DECOUPLED_CHANNEL_MESSAGE flag set",
                      Boolean.TRUE,
                      inMessage.get(DECOUPLED_CHANNEL_MESSAGE));
+        assertEquals("unexpected HTTP_REQUEST set",
+                     false,
+                     inMessage.containsKey(HTTPConduit.HTTP_REQUEST));
+        assertEquals("unexpected HTTP_RESPONSE set",
+                     false,
+                     inMessage.containsKey(HTTPConduit.HTTP_RESPONSE));
+        assertEquals("unexpected Message.ASYNC_POST_RESPONSE_DISPATCH set",
+                     false,
+                     inMessage.containsKey(Message.ASYNC_POST_RESPONSE_DISPATCH));
     }
 
     private void finalVerify() {



Mime
View raw message