cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r544926 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/endpoint/ rt/core/src/main/java/org/apache/cxf/clustering/ rt/core/src/main/java/org/apache/cxf/transport/ rt/transports/local/src/main/java/org/apache/cxf/transport/local/
Date Wed, 06 Jun 2007 19:31:14 GMT
Author: dkulp
Date: Wed Jun  6 12:31:12 2007
New Revision: 544926

URL: http://svn.apache.org/viewvc?view=rev&rev=544926
Log:
Make sure conduit.close(Message) is called on client side to close the streams

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/DeferredConduitSelector.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/PreexistingConduitSelector.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/UpfrontConduitSelector.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
    incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
Wed Jun  6 12:31:12 2007
@@ -118,6 +118,21 @@
         return exchange.get(Bus.class);
     }
     
+    
+    /**
+     * Called on completion of the MEP for which the Conduit was required.
+     * 
+     * @param exchange represents the completed MEP
+     */
+    public void complete(Exchange exchange) {
+        try {
+            if (exchange.getInMessage() != null) {
+                getSelectedConduit(exchange.getInMessage()).close(exchange.getInMessage());
+            }
+        } catch (IOException e) {
+            //IGNORE
+        }
+    }    
     /**
      * @return the logger to use
      */

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/DeferredConduitSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/DeferredConduitSelector.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/DeferredConduitSelector.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/DeferredConduitSelector.java
Wed Jun  6 12:31:12 2007
@@ -22,7 +22,6 @@
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.transport.Conduit;
 
@@ -68,15 +67,6 @@
      */
     public Conduit selectConduit(Message message) {
         return getSelectedConduit(message);
-    }
-
-    /**
-     * Called on completion of the MEP for which the Conduit was required.
-     * 
-     * @param exchange represents the completed MEP
-     */    
-    public void complete(Exchange exchange) {
-        // nothing to do
     }
 
     /**

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/PreexistingConduitSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/PreexistingConduitSelector.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/PreexistingConduitSelector.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/PreexistingConduitSelector.java
Wed Jun  6 12:31:12 2007
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.endpoint;
 
+import java.io.IOException;
+
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.transport.Conduit;
@@ -84,7 +86,13 @@
      * @param exchange represents the completed MEP
      */
     public void complete(Exchange exchange) {
-        // nothing to do
+        try {
+            if (exchange.getInMessage() != null) {
+                selectedConduit.close(exchange.getInMessage());
+            }
+        } catch (IOException e) {
+            //IGNORE
+        }
     }
     
     /**

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/UpfrontConduitSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/UpfrontConduitSelector.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/UpfrontConduitSelector.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/UpfrontConduitSelector.java
Wed Jun  6 12:31:12 2007
@@ -23,7 +23,6 @@
 
 //import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.transport.Conduit;
 
@@ -70,15 +69,6 @@
      */
     public Conduit selectConduit(Message message) {
         return getSelectedConduit(message);
-    }
-    
-    /**
-     * Called on completion of the MEP for which the Conduit was required.
-     * 
-     * @param exchange represents the completed MEP
-     */
-    public void complete(Exchange exchange) {
-        // nothing to do
     }
     
     /**

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
Wed Jun  6 12:31:12 2007
@@ -159,6 +159,7 @@
             synchronized (this) {
                 inProgress.remove(key);
             }
+            super.complete(exchange);
         }
     }
     

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
Wed Jun  6 12:31:12 2007
@@ -20,6 +20,7 @@
 package org.apache.cxf.transport;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 
 import org.apache.cxf.message.Message;
@@ -57,12 +58,16 @@
     }
 
     /**
-     * @param message for which content shoul dbe closed.
+     * @param message for which content should be closed.
      */    
     public void close(Message msg) throws IOException {
         OutputStream os = msg.getContent(OutputStream.class);
         if (os != null) {
             os.close();
+        }
+        InputStream in = msg.getContent(InputStream.class);
+        if (in != null) {
+            in.close();
         }
     }
     

Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?view=diff&rev=544926&r1=544925&r2=544926
==============================================================================
--- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
Wed Jun  6 12:31:12 2007
@@ -64,7 +64,8 @@
 
     @Override
     public void close(Message message) throws IOException {
-        if (Boolean.TRUE.equals(message.get(DIRECT_DISPATCH))) {
+        if (Boolean.TRUE.equals(message.get(DIRECT_DISPATCH))
+            && !Boolean.TRUE.equals(message.get(Message.INBOUND_MESSAGE))) {
             dispatchDirect(message);
         } 
         



Mime
View raw message