cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r898517 - in /cxf/branches/2.1.x-fixes: ./ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/ systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ systests/ws-specs/src/test/java/org/apac...
Date Tue, 12 Jan 2010 21:09:49 GMT
Author: dkulp
Date: Tue Jan 12 21:09:48 2010
New Revision: 898517

URL: http://svn.apache.org/viewvc?rev=898517&view=rev
Log:
Merged revisions 898514 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r898514 | dkulp | 2010-01-12 16:02:16 -0500 (Tue, 12 Jan 2010) | 11 lines
  
  Merged revisions 898509 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r898509 | dkulp | 2010-01-12 15:56:38 -0500 (Tue, 12 Jan 2010) | 3 lines
    
    [CXF-2466] Clean up stack traces from retransmit issues
    Also fix problems with SequenceTest running in my eclipse workspace.
    This MAY fix the random failures in some of the SequenceTests
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
    cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
    cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
    cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/InMessageRecorder.java
    cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/OutMessageRecorder.java

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

Modified: cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java?rev=898517&r1=898516&r2=898517&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
Tue Jan 12 21:09:48 2010
@@ -48,7 +48,7 @@
     }
     public void onClose(CachedOutputStream cos) {
    
-        //REVISIT - would be nice to keep the cache on disk intead of in-memory 
+        //REVISIT - would be nice to keep the cache on disk instead of in-memory 
         byte bytes[] = null;
         try {
             bytes = cos.getBytes();

Modified: cxf/branches/2.1.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.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java?rev=898517&r1=898516&r2=898517&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
Tue Jan 12 21:09:48 2010
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigInteger;
+import java.net.ConnectException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -262,6 +263,10 @@
         if (null != maps) {
             to = maps.getTo();
         }
+        if (RMUtils.getAddressingConstants().getAnonymousURI().equals(to.getValue())) {
+            LOG.log(Level.FINE, "Cannot resend to anonymous target");
+            return;
+        }
         if (null == to) {
             LOG.log(Level.SEVERE, "NO_ADDRESS_FOR_RESEND_MSG");
             return;
@@ -317,10 +322,11 @@
             if (os instanceof CachedOutputStream) {
                 callbacks = ((CachedOutputStream)os).getCallbacks();
             }
-            
+            message.removeContent(OutputStream.class);
             c.prepare(message);
 
             os = message.getContent(OutputStream.class);
+            
             if (null != callbacks && callbacks.size() > 1) {
                 if (!(os instanceof CachedOutputStream)) {
                     os = RMUtils.createCachedStream(message, os);
@@ -349,6 +355,8 @@
             IOUtils.copyAndCloseInput(bis, os);
             os.flush();
             os.close();
+        } catch (ConnectException ex) {
+            //ignore, we'll just resent again later
         } catch (IOException ex) {
             LOG.log(Level.SEVERE, "RESEND_FAILED_MSG", ex);
         }
@@ -359,6 +367,7 @@
      */
     protected class ResendCandidate implements Runnable {
         private Message message;
+        private OutputStream out;
         private Date next;
         private TimerTask nextTask;
         private int resends;
@@ -373,6 +382,7 @@
         protected ResendCandidate(Message m) {
             message = m;
             resends = 0;
+            out = m.getContent(OutputStream.class);
             RMAssertion rma = PolicyUtils.getRMAssertion(manager.getRMAssertion(), message);
             long baseRetransmissionInterval = 
                 rma.getBaseRetransmissionInterval().getMilliseconds().longValue();
@@ -380,6 +390,18 @@
                 ? RetransmissionQueue.DEFAULT_EXPONENTIAL_BACKOFF : 1;
             next = new Date(System.currentTimeMillis() + baseRetransmissionInterval);
             nextInterval = baseRetransmissionInterval * backoff;
+            
+            
+            AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, true);
+            AttributedURIType to = null;
+            if (null != maps) {
+                to = maps.getTo();
+            }
+            if (to != null 
+                && RMUtils.getAddressingConstants().getAnonymousURI().equals(to.getValue()))
{
+                LOG.log(Level.INFO, "Cannot resend to anonymous target.  Not scheduling a
resend.");
+                return;
+            }
             if (null != manager.getTimer()) {
                 schedule();
             }
@@ -415,6 +437,7 @@
                 // ensure ACK wasn't received while this task was enqueued
                 // on executor
                 if (isPending()) {
+                    message.setContent(OutputStream.class, out);
                     resender.resend(message, includeAckRequested);
                     includeAckRequested = false;
                 }

Modified: cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=898517&r1=898516&r2=898517&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Tue Jan 12 21:09:48 2010
@@ -160,7 +160,6 @@
     }
 
     // --- tests ---
-    
     @Test
     public void testOnewayAnonymousAcks() throws Exception {
         init("org/apache/cxf/systest/ws/rm/rminterceptors.xml");
@@ -520,16 +519,14 @@
 
     }
     
-    /**
-     * A maximum sequence length of 2 is configured for the client only (server allows 10).
-     * However, as we use the defaults regarding the including and acceptance
-     * for inbound sequence offers and correlate offered sequences that are
-     * included in a CreateSequence request and accepted with those that are
-     * created on behalf of such a request, the server also tries terminate its
-     * sequences. Note that as part of the sequence termination exchange a
-     * standalone sequence acknowledgment needs to be sent regardless of whether
-     * or nor acknowledgments are delivered steadily with every response.
-     */
+    // A maximum sequence length of 2 is configured for the client only (server allows 10).
+    // However, as we use the defaults regarding the including and acceptance
+    // for inbound sequence offers and correlate offered sequences that are
+    // included in a CreateSequence request and accepted with those that are
+    // created on behalf of such a request, the server also tries terminate its
+    // sequences. Note that as part of the sequence termination exchange a
+    // standalone sequence acknowledgment needs to be sent regardless of whether
+    // or nor acknowledgments are delivered steadily with every response.
     @Test
     public void testTwowayNonAnonymousMaximumSequenceLength2() throws Exception {
         init("org/apache/cxf/systest/ws/rm/seqlength10.xml", true);
@@ -1200,7 +1197,6 @@
         mf.verifyAcknowledgements(new boolean[] {false, true}, false);
         
     }    
-
     // --- test utilities ---
 
     private void init(String cfgResource) {

Modified: cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/InMessageRecorder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/InMessageRecorder.java?rev=898517&r1=898516&r2=898517&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/InMessageRecorder.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/InMessageRecorder.java
Tue Jan 12 21:09:48 2010
@@ -20,8 +20,8 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -40,7 +40,7 @@
 
     public InMessageRecorder() {
         super(Phase.RECEIVE);
-        inbound = new ArrayList<byte[]>();
+        inbound = new CopyOnWriteArrayList<byte[]>();
     }
 
     public void handleMessage(Message message) throws Fault {

Modified: cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/OutMessageRecorder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/OutMessageRecorder.java?rev=898517&r1=898516&r2=898517&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/OutMessageRecorder.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/util/OutMessageRecorder.java
Tue Jan 12 21:09:48 2010
@@ -20,8 +20,8 @@
 package org.apache.cxf.systest.ws.util;
 
 import java.io.OutputStream;
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -48,12 +48,13 @@
 
     public OutMessageRecorder() {
         super(Phase.PRE_STREAM);
-        outbound = new ArrayList<byte[]>();
+        outbound = new CopyOnWriteArrayList<byte[]>();
         addAfter(RetransmissionInterceptor.class.getName());
         addBefore(StaxOutInterceptor.class.getName());
     }
     
     public void handleMessage(Message message) throws Fault {
+        
         OutputStream os = message.getContent(OutputStream.class);
         if (null == os) {
             return;



Mime
View raw message