Author: ffang Date: Fri Oct 29 09:04:41 2010 New Revision: 1028651 URL: http://svn.apache.org/viewvc?rev=1028651&view=rev Log: Merged revisions 1028647 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes
................ r1028647 | ffang | 2010-10-29 16:49:28 +0800 (五, 29 10 2010) | 9 lines 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.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java Fri Oct 29 09:04:41 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.2.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd (original) +++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd Fri Oct 29 09:04:41 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.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java Fri Oct 29 09:04:41 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.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java Fri Oct 29 09:04:41 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.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml (original) +++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/feature.xml Fri Oct 29 09:04:41 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.2.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.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml (original) +++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/manager-bean.xml Fri Oct 29 09:04:41 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.2.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.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java?rev=1028651&r1=1028650&r2=1028651&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java Fri Oct 29 09:04:41 2010 @@ -161,7 +161,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()) { @@ -175,12 +175,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,
