You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by eg...@apache.org on 2009/02/24 15:08:35 UTC

svn commit: r747386 - in /cxf/trunk: 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/src/test/java/org/apache/cxf/systest/ws/rm/

Author: eglynn
Date: Tue Feb 24 14:08:35 2009
New Revision: 747386

URL: http://svn.apache.org/viewvc?rev=747386&view=rev
Log:
Added support for a <wsrm-mgr:deliveryAssurance> of ExactlyOnce, conjoining AtMostOnce and AtLeastOnce. 

Added:
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/exactly-once.xml
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/exactlyonce.xml
Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?rev=747386&r1=747385&r2=747386&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Tue Feb 24 14:08:35 2009
@@ -129,7 +129,7 @@
 
     @PostConstruct
     public void register() {
-        if (null != bus) {
+        if (null != bus) { 
             bus.setExtension(this, RMManager.class);
         }
     }
@@ -471,10 +471,19 @@
             setRMAssertion(null);
         }
         org.apache.cxf.ws.rm.manager.ObjectFactory factory = new org.apache.cxf.ws.rm.manager.ObjectFactory();
+        DeliveryAssuranceType da = factory.createDeliveryAssuranceType();
         if (null == deliveryAssurance) {
-            DeliveryAssuranceType da = factory.createDeliveryAssuranceType();
             da.setAtLeastOnce(factory.createDeliveryAssuranceTypeAtLeastOnce());
             setDeliveryAssurance(da);
+        } else if (deliveryAssurance.isSetExactlyOnce()) {
+            if (!deliveryAssurance.isSetAtMostOnce()) {
+                deliveryAssurance.setAtMostOnce(
+                    factory.createDeliveryAssuranceTypeAtMostOnce());
+            }
+            if (!deliveryAssurance.isSetAtLeastOnce()) {
+                deliveryAssurance.setAtLeastOnce(
+                    factory.createDeliveryAssuranceTypeAtLeastOnce());
+            }
         }
         if (null == sourcePolicy) {
             setSourcePolicy(null);
@@ -495,7 +504,7 @@
     
     @PostConstruct
     void registerListeners() {
-        if (null == bus) { 
+        if (null == bus) {
             return;
         }
         ServerLifeCycleManager slm = bus.getExtension(ServerLifeCycleManager.class);

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd?rev=747386&r1=747385&r2=747386&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd Tue Feb 24 14:08:35 2009
@@ -182,6 +182,11 @@
                     <xs:sequence/>
                 </xs:complexType>
             </xs:element>
+            <xs:element name="ExactlyOnce" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence/>
+                </xs:complexType>
+            </xs:element>
             <xs:element name="InOrder" minOccurs="0">
                 <xs:complexType>
                     <xs:sequence/>

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java?rev=747386&r1=747385&r2=747386&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java Tue Feb 24 14:08:35 2009
@@ -51,6 +51,19 @@
         RMManager manager = bus.getExtension(RMManager.class);
         verifyManager(manager);
     }
+
+    @Test
+    public void testExactlyOnce() {
+        SpringBusFactory factory = new SpringBusFactory();
+        bus = factory.createBus("org/apache/cxf/ws/rm/exactly-once.xml", false);
+        RMManager manager = bus.getExtension(RMManager.class);
+        assertNotNull(manager.getDeliveryAssurance().getAtLeastOnce());
+        assertTrue(manager.getDeliveryAssurance().isSetAtLeastOnce());
+        assertNotNull(manager.getDeliveryAssurance().getAtMostOnce());
+        assertTrue(manager.getDeliveryAssurance().isSetAtMostOnce());
+        assertNotNull(manager.getDeliveryAssurance().getExactlyOnce());
+        assertTrue(manager.getDeliveryAssurance().isSetExactlyOnce());
+    }
     
     @Test
     public void testFeature() {
@@ -70,11 +83,9 @@
                      .getMilliseconds().longValue());        
         TestStore store = (TestStore)manager.getStore();
         assertEquals("here", store.getLocation());     
-        assertNull(manager.getDeliveryAssurance().getAtLeastOnce());
-        assertNull(manager.getDeliveryAssurance().getAtMostOnce());
         assertNotNull(manager.getDeliveryAssurance().getInOrder());
     }
-    
+
     static class TestStore implements RMStore {
         
         private String location;

Added: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/exactly-once.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/exactly-once.xml?rev=747386&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/exactly-once.xml (added)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/exactly-once.xml Tue Feb 24 14:08:35 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"       
+       xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+       xsi:schemaLocation="
+http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+   
+    <import resource="rmmanager.xml"/>  
+    
+    <wsrm-mgr:rmManager name="{http://cxf.apache.org}ws.rm.RMManager">
+      <wsrm-mgr:deliveryAssurance>
+          <wsrm-mgr:ExactlyOnce/>
+      </wsrm-mgr:deliveryAssurance>
+    </wsrm-mgr:rmManager>
+    
+</beans>

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=747386&r1=747385&r2=747386&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Tue Feb 24 14:08:35 2009
@@ -588,7 +588,17 @@
     
     @Test
     public void testTwowayAtMostOnce() throws Exception {
-        init("org/apache/cxf/systest/ws/rm/atmostonce.xml");
+        doTestTwowayNoDuplicates("org/apache/cxf/systest/ws/rm/atmostonce.xml");
+    }
+
+    @Test
+    public void testTwowayExactlyOnce() throws Exception {
+        doTestTwowayNoDuplicates("org/apache/cxf/systest/ws/rm/exactlyonce.xml");
+    }
+
+    private void doTestTwowayNoDuplicates(String cfg) throws Exception {
+
+        init(cfg);
         
         class MessageNumberInterceptor extends AbstractPhaseInterceptor {
             public MessageNumberInterceptor() {

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/exactlyonce.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/exactlyonce.xml?rev=747386&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/exactlyonce.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/exactlyonce.xml Tue Feb 24 14:08:35 2009
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
+	xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+	xsi:schemaLocation="
+http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<import resource="rminterceptors.xml" />
+
+	<wsrm-mgr:rmManager id="org.apache.cxf.ws.rm.RMManager">
+        <wsrm-policy:RMAssertion>
+			<wsrm-policy:BaseRetransmissionInterval Milliseconds="60000" />
+			<wsrm-policy:AcknowledgementInterval Milliseconds="10000" />
+		</wsrm-policy:RMAssertion>
+		<wsrm-mgr:deliveryAssurance>
+			<wsrm-mgr:ExactlyOnce />
+		</wsrm-mgr:deliveryAssurance>
+		<wsrm-mgr:destinationPolicy>
+			<wsrm-mgr:acksPolicy intraMessageThreshold="0" />
+		</wsrm-mgr:destinationPolicy>
+	</wsrm-mgr:rmManager>
+
+
+</beans>