cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1127347 - in /cxf/branches/2.3.x-fixes: ./ rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/ rt/transports/local/src/main/java/org/apache/cxf/transport/local/ systests/transports/src/test/java/org/apache/cxf/systest/...
Date Wed, 25 May 2011 01:03:03 GMT
Author: dkulp
Date: Wed May 25 01:03:03 2011
New Revision: 1127347

URL: http://svn.apache.org/viewvc?rev=1127347&view=rev
Log:
Merged revisions 1127323 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1127323 | dkulp | 2011-05-24 18:40:42 -0400 (Tue, 24 May 2011) | 2 lines
  
  [CXF-3545] Use the "correct" streams when copying content in direct
  dispatch mode.
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java
    cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
    cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/DirectDispatchClientTest.java
    cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/Server.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java?rev=1127347&r1=1127346&r2=1127347&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java
Wed May 25 01:03:03 2011
@@ -106,6 +106,11 @@ public class GZIPOutInterceptor extends 
         super(Phase.PREPARE_SEND);
         addAfter(MessageSenderInterceptor.class.getName());
     }
+    public GZIPOutInterceptor(int threshold) {
+        super(Phase.PREPARE_SEND);
+        addAfter(MessageSenderInterceptor.class.getName());
+        this.threshold = threshold;
+    }
 
     public void setThreshold(int threshold) {
         this.threshold = threshold;

Modified: cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?rev=1127347&r1=1127346&r2=1127347&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
Wed May 25 01:03:03 2011
@@ -91,9 +91,11 @@ public class LocalConduit extends Abstra
         
         OutputStream out = message.getContent(OutputStream.class);
         out.flush();
+        out.close();
         
         CachedOutputStream stream = message.get(CachedOutputStream.class);
         copy.setContent(InputStream.class, stream.getInputStream());
+        copy.removeContent(CachedOutputStream.class);
 
         // Create a new incoming exchange and store the original exchange for the response
         ExchangeImpl ex = new ExchangeImpl();

Modified: cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=1127347&r1=1127346&r2=1127347&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Wed May 25 01:03:03 2011
@@ -107,6 +107,7 @@ public class LocalDestination extends Ab
             } else {
                 CachedOutputStream stream = new CachedOutputStream();
                 message.setContent(OutputStream.class, stream);
+                message.setContent(CachedOutputStream.class, stream);
             }
         }
 
@@ -117,8 +118,10 @@ public class LocalDestination extends Ab
                 
                 MessageImpl copy = new MessageImpl();
                 copy.putAll(message);
+                message.getContent(OutputStream.class).close();
+                CachedOutputStream stream = message.getContent(CachedOutputStream.class);
+                message.setContent(OutputStream.class, stream);
                 MessageImpl.copyContent(message, copy);
-                CachedOutputStream stream = (CachedOutputStream)message.getContent(OutputStream.class);
                 copy.setContent(InputStream.class, stream.getInputStream());
                 if (exchange != null && exchange.getInMessage() == null) {
                     exchange.setInMessage(copy);

Modified: cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/DirectDispatchClientTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/DirectDispatchClientTest.java?rev=1127347&r1=1127346&r2=1127347&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/DirectDispatchClientTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/DirectDispatchClientTest.java
Wed May 25 01:03:03 2011
@@ -30,7 +30,11 @@ import javax.xml.ws.Service;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.transport.common.gzip.GZIPInInterceptor;
+import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor;
 import org.apache.cxf.transport.local.LocalConduit;
 import org.apache.hello_world_soap_http.Greeter;
 
@@ -71,6 +75,9 @@ public class DirectDispatchClientTest ex
         Greeter greeter = service.getPort(localPortName, Greeter.class);
         
         if (isDirectDispatch) {
+            Client client = ClientProxy.getClient(greeter);
+            client.getOutInterceptors().add(new GZIPOutInterceptor(50));
+            client.getInInterceptors().add(new GZIPInInterceptor());
             InvocationHandler handler  = Proxy.getInvocationHandler(greeter);
             BindingProvider  bp = null;
             if (handler instanceof BindingProvider) {

Modified: cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/Server.java?rev=1127347&r1=1127346&r2=1127347&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/Server.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/local_transport/Server.java
Wed May 25 01:03:03 2011
@@ -19,10 +19,12 @@
 
 package org.apache.cxf.systest.local_transport;
 
+import javax.jws.WebService;
 import javax.xml.ws.Endpoint;
 
+import org.apache.cxf.annotations.GZIP;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.apache.hello_world_soap_http.GreeterImpl;
+import org.apache.hello_world_soap_http.BaseGreeterImpl;
 
 public class Server extends AbstractBusTestServerBase {
 
@@ -44,5 +46,17 @@ public class Server extends AbstractBusT
             System.out.println("done!");
         }
     }
+    
+
+    @WebService(serviceName = "SOAPService",
+                portName = "SoapPort",
+                endpointInterface = "org.apache.hello_world_soap_http.Greeter",
+                targetNamespace = "http://apache.org/hello_world_soap_http",
+                wsdlLocation = "testutils/hello_world.wsdl")
+    @GZIP(threshold = 50)            
+    public class GreeterImpl extends BaseGreeterImpl {
+
+
+    }
 }
 



Mime
View raw message