Author: ay
Date: Wed Mar 21 10:16:52 2012
New Revision: 1303342
URL: http://svn.apache.org/viewvc?rev=1303342&view=rev
Log:
adding another fix and test to CXF-4188
Added:
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-atmostonce-server.xml
(with props)
Modified:
cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java
cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java?rev=1303342&r1=1303341&r2=1303342&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Destination.java Wed Mar 21 10:16:52
2012
@@ -213,6 +213,17 @@ public class Destination extends Abstrac
}
}
+ void releaseDeliveringStatus(Message message) {
+ RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
+ SequenceType sequenceType = rmps.getSequence();
+ if (null != sequenceType) {
+ DestinationSequence seq = getSequence(sequenceType.getIdentifier());
+ if (null != seq) {
+ seq.removeDeliveringMessageNumber(sequenceType.getMessageNumber());
+ }
+ }
+ }
+
private static Message createMessage(Exchange exchange) {
Endpoint ep = exchange.get(Endpoint.class);
Message msg = null;
Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java?rev=1303342&r1=1303341&r2=1303342&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java Wed Mar
21 10:16:52 2012
@@ -253,7 +253,7 @@ public class DestinationSequence extends
}
if (robust && !robustDelivering) {
// no check performed if in robust and not in delivering
- deliveringMessageNumbers.remove(mn);
+ removeDeliveringMessageNumber(mn);
return true;
}
if (cont != null && da.isSetInOrder() && !cont.isNew()) {
@@ -280,6 +280,10 @@ public class DestinationSequence extends
return true;
}
+ void removeDeliveringMessageNumber(long mn) {
+ deliveringMessageNumbers.remove(mn);
+ }
+
private Continuation getContinuation(Message message) {
if (message == null) {
return null;
Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java?rev=1303342&r1=1303341&r2=1303342&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java Wed Mar 21
10:16:52 2012
@@ -47,6 +47,15 @@ public class RMInInterceptor extends Abs
@Override
public void handleFault(Message message) {
message.put(MAPAggregator.class.getName(), true);
+ if (MessageUtils.isTrue(message.get(RMMessageConstants.DELIVERING_ROBUST_ONEWAY)))
{
+ // revert the delivering entry from the destination sequence
+ try {
+ Destination destination = getManager().getDestination(message);
+ destination.releaseDeliveringStatus(message);
+ } catch (RMException e) {
+ LOG.log(Level.WARNING, "Failed to revert the delivering status");
+ }
+ }
}
protected void handle(Message message) throws SequenceFault, RMException {
Added: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java?rev=1303342&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java
(added)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java
Wed Mar 21 10:16:52 2012
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.rm;
+
+/**
+ * Tests the acknowledgement delivery back to the non-decoupled port when there is some
+ * error at the provider side and how its behavior is affected by the robust in-only mode
setting.
+ */
+public class ServiceInvocationAtMostOnceAckTest extends ServiceInvocationAckBase {
+ protected void setupGreeter() throws Exception {
+ setupGreeter("org/apache/cxf/systest/ws/rm/sync-ack-atmostonce-server.xml");
+ }
+}
Added: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-atmostonce-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-atmostonce-server.xml?rev=1303342&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-atmostonce-server.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-atmostonce-server.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
|