cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1028647 - in /cxf/branches/2.3.x-fixes: ./ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/resources/schemas/configuration/ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ systests/ws-specs/src/test/java/org/apache/cxf/systest/...
Date Fri, 29 Oct 2010 08:49:29 GMT
Author: ffang
Date: Fri Oct 29 08:49:28 2010
New Revision: 1028647

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

........
  r1028170 | ffang | 2010-10-28 10:20:46 +0800 (四, 28 10 2010) | 1 line
  
  [CXF-3097]ws-rm ImmediateAcknowledgement doesn't work for ws-rm client side
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
    cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
    cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
    cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
    cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml
    cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml
    cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Oct 29 08:49:28 2010
@@ -1 +1 @@
-/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553,1027599
+/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553,1027599,1028170

Modified: cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
Fri Oct 29 08:49:28 2010
@@ -292,6 +292,9 @@ public class DestinationSequence extends
         } else {
             LOG.fine("Schedule immediate acknowledgment");
             scheduleImmediateAcknowledgement();
+            destination.getManager().getTimer().schedule(
+                new ImmediateFallbackAcknowledgment(), ap.getImmediaAcksTimeout().longValue());
+           
         }
     }
 
@@ -370,6 +373,26 @@ public class DestinationSequence extends
         }
     }
     
+    final class ImmediateFallbackAcknowledgment extends TimerTask {
+       
+        public void run() {
+            LOG.fine("timer task: send acknowledgment.");
+            if (!sendAcknowledgement()) {
+                //Acknowledgment already get send out
+                return;
+            }
+
+            try {                
+                RMEndpoint rme = destination.getReliableEndpoint();
+                Proxy proxy = rme.getProxy();
+                proxy.acknowledge(DestinationSequence.this);
+            } catch (RMException ex) {
+                // already logged
+            } 
+
+        }
+    }
+    
     final class SequenceTermination extends TimerTask {
         
         private long maxInactivityTimeout;

Modified: cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
Fri Oct 29 08:49:28 2010
@@ -168,6 +168,16 @@
                 </xs:documentation>
             </xs:annotation>      
         </xs:attribute> 
+        <xs:attribute name="ImmediaAcksTimeout" type="xs:unsignedLong" use="optional"
default="1000">
+        <xs:annotation>
+                <xs:documentation>
+                    Timeout in millisecond. If timeout for a immediateAcks, then consider
there's no 
+                    next invocation request in this sequence which can piggyback the SequenceAcknowledgement
header.
+                    Need create and send out a out-of-band SequenceAcknowledgement message
 
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+
     </xs:complexType>
     
     <xs:complexType name="DeliveryAssuranceType">

Modified: cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
Fri Oct 29 08:49:28 2010
@@ -140,7 +140,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testAcknowledgeBasic() throws SequenceFault {
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message message1 = setUpMessage("1");
         Message message2 = setUpMessage("2");
         control.replay();
@@ -166,7 +167,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testAcknowledgeLastMessageNumberExceeded() throws SequenceFault {  
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message message1 = setUpMessage("1");
         Message message2 = setUpMessage("2");
         control.replay();
@@ -187,7 +189,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testAcknowledgeAppendRange() throws SequenceFault {
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message[] messages = new Message [] {
             setUpMessage("1"),
             setUpMessage("2"),
@@ -216,7 +219,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testAcknowledgeInsertRange() throws SequenceFault {
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message[] messages = new Message [] {
             setUpMessage("1"),
             setUpMessage("2"),
@@ -250,7 +254,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testAcknowledgePrependRange() throws SequenceFault { 
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message[] messages = new Message [] {
             setUpMessage("4"),
             setUpMessage("5"),
@@ -323,7 +328,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testMonitor() throws SequenceFault {
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message[] messages = new Message[15];
         for (int i = 0; i < messages.length; i++) {
             messages[i] = setUpMessage(Integer.toString(i + 1));
@@ -365,7 +371,8 @@ public class DestinationSequenceTest ext
     
     @Test
     public void testAcknowledgeImmediate() throws SequenceFault {
-        setUpDestination();
+        Timer timer = control.createMock(Timer.class);
+        setUpDestination(timer);
         Message message = setUpMessage("1");
         control.replay();
         

Modified: cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
Fri Oct 29 08:49:28 2010
@@ -77,6 +77,8 @@ public class RMManagerConfigurationTest 
         assertNotNull(manager);
         assertTrue(manager.getSourcePolicy().getSequenceTerminationPolicy().isTerminateOnShutdown());
         assertEquals(0L, manager.getDestinationPolicy().getAcksPolicy().getIntraMessageThreshold());
+        assertEquals(2000L, manager.getDestinationPolicy().getAcksPolicy().
+                getImmediaAcksTimeout().longValue());
         assertEquals(10000L, manager.getRMAssertion().getBaseRetransmissionInterval()
                      .getMilliseconds().longValue());
         assertEquals(10000L, manager.getRMAssertion().getAcknowledgementInterval()

Modified: cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml (original)
+++ cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml Fri Oct
29 08:49:28 2010
@@ -43,7 +43,7 @@ http://www.springframework.org/schema/be
                     <wsrm-mgr:sequenceTerminationPolicy terminateOnShutdown="true"/>
                   
                 </wsrm-mgr:sourcePolicy>
                 <wsrm-mgr:destinationPolicy>
-                    <wsrm-mgr:acksPolicy intraMessageThreshold="0"/>              
     
+                    <wsrm-mgr:acksPolicy ImmediaAcksTimeout="2000" intraMessageThreshold="0"/>
                   
                 </wsrm-mgr:destinationPolicy>
                 <wsrm-mgr:store>
                     <bean class="org.apache.cxf.ws.rm.RMManagerConfigurationTest$TestStore">

Modified: cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml
Fri Oct 29 08:49:28 2010
@@ -42,7 +42,7 @@ http://www.springframework.org/schema/be
           <wsrm-mgr:sequenceTerminationPolicy terminateOnShutdown="true"/>        
           
       </wsrm-mgr:sourcePolicy>
       <wsrm-mgr:destinationPolicy>
-          <wsrm-mgr:acksPolicy intraMessageThreshold="0"/>                    
+          <wsrm-mgr:acksPolicy ImmediaAcksTimeout="2000" intraMessageThreshold="0"/>
                   
       </wsrm-mgr:destinationPolicy>
       <wsrm-mgr:store>
           <bean class="org.apache.cxf.ws.rm.RMManagerConfigurationTest$TestStore">

Modified: cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java?rev=1028647&r1=1028646&r2=1028647&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
Fri Oct 29 08:49:28 2010
@@ -163,7 +163,7 @@ public class ServerPersistenceTest exten
         awaitMessages(4, 6, 20000);
 
         // wait another while to prove that response to second request is indeed lost
-        Thread.sleep(1000);
+        Thread.sleep(4000);
         int nDone = 0;
         for (int i = 0; i < responses.length; i++) {
             if (responses[i].isDone()) {
@@ -177,12 +177,13 @@ public class ServerPersistenceTest exten
         String[] expectedActions = new String[] {RMConstants.getCreateSequenceAction(),
                                                  GREETME_ACTION,
                                                  GREETME_ACTION,
-                                                 GREETME_ACTION};
+                                                 GREETME_ACTION,
+                                                 RMConstants.getSequenceAckAction()};
         mf.verifyActions(expectedActions, true);
         // mf.verifyMessageNumbers(new String[] {null, "1", "2", "3"}, true);
         // mf.verifyAcknowledgements(new boolean[] {false, false, true, false}, true);
         
-        mf.verifyPartialResponses(4);
+        mf.verifyPartialResponses(5);
         mf.purgePartialResponses();
         expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(),
                                         GREETME_RESPONSE_ACTION,



Mime
View raw message