cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1350758 - in /cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm: RMCaptureInInterceptor.java RetransmissionCallback.java persistence/jdbc/RMTxStore.java soap/RetransmissionQueueImpl.java
Date Fri, 15 Jun 2012 19:50:56 GMT
Author: dkulp
Date: Fri Jun 15 19:50:56 2012
New Revision: 1350758

URL: http://svn.apache.org/viewvc?rev=1350758&view=rev
Log:
Merged revisions 1350750 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1350750 | dkulp | 2012-06-15 15:36:34 -0400 (Fri, 15 Jun 2012) | 10 lines

  Merged revisions 1350633 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1350633 | ay | 2012-06-15 10:09:01 -0400 (Fri, 15 Jun 2012) | 2 lines

    [CXF-4383] Some temporary files are not deleted after WS-RM scenarios

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMCaptureInInterceptor.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMCaptureInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMCaptureInInterceptor.java?rev=1350758&r1=1350757&r2=1350758&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMCaptureInInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMCaptureInInterceptor.java
Fri Jun 15 19:50:56 2012
@@ -54,6 +54,7 @@ public class RMCaptureInInterceptor exte
 
                     saved.flush();
                     is.close();
+                    saved.lockOutputStream();
 
                     message.setContent(InputStream.class, saved.getInputStream());
                     LOG.fine("Capturing the original RM message");

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java?rev=1350758&r1=1350757&r2=1350758&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
Fri Jun 15 19:50:56 2012
@@ -48,6 +48,7 @@ public class RetransmissionCallback impl
         saved.holdTempFile();
         try {
             cos.writeCacheTo(saved);            
+            saved.lockOutputStream();
         } catch (IOException e) {
             // ignore
         }

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java?rev=1350758&r1=1350757&r2=1350758&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
Fri Jun 15 19:50:56 2012
@@ -626,16 +626,28 @@ public class RMTxStore implements RMStor
             LOG.log(Level.FINE, "Storing {0} message number {1} for sequence {2}, to = {3}",
                     new Object[] {outbound ? "outbound" : "inbound", nr, id, to});
         }
-        PreparedStatement stmt = outbound ? createOutboundMessageStmt : createInboundMessageStmt;
-        int i = 1;
-        stmt.setString(i++, id);  
-        stmt.setLong(i++, nr);
-        stmt.setString(i++, to); 
-        stmt.setBinaryStream(i++, msg.getInputStream(), (int)msg.getSize());
-        stmt.execute();
-        if (LOG.isLoggable(Level.FINE)) {
-            LOG.log(Level.FINE, "Successfully stored {0} message number {1} for sequence
{2}",
-                    new Object[] {outbound ? "outbound" : "inbound", nr, id});
+        InputStream msgin = null;
+        try {
+            msgin = msg.getInputStream();
+            PreparedStatement stmt = outbound ? createOutboundMessageStmt : createInboundMessageStmt;
+            int i = 1;
+            stmt.setString(i++, id);  
+            stmt.setLong(i++, nr);
+            stmt.setString(i++, to); 
+            stmt.setBinaryStream(i++, msgin, (int)msg.getSize());
+            stmt.execute();
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "Successfully stored {0} message number {1} for sequence
{2}",
+                        new Object[] {outbound ? "outbound" : "inbound", nr, id});
+            }
+        } finally  {
+            if (msgin != null) {
+                try {
+                    msgin.close();
+                } catch (IOException e) {
+                    // ignore
+                }
+            }
         }
         
     }

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java?rev=1350758&r1=1350757&r2=1350758&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
Fri Jun 15 19:50:56 2012
@@ -642,6 +642,12 @@ public class RetransmissionQueueImpl imp
             CachedOutputStream saved = (CachedOutputStream)message.remove(RMMessageConstants.SAVED_CONTENT);
             if (saved != null) {
                 saved.releaseTempFileHold();
+                // call close to dispose
+                try {
+                    saved.close();
+                } catch (IOException e) {
+                    // ignore
+                }
             }
         }
 



Mime
View raw message