cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsosno...@apache.org
Subject svn commit: r1489358 - in /cxf/trunk/rt/ws/rm/src: main/java/org/apache/cxf/ws/rm/ main/java/org/apache/cxf/ws/rm/blueprint/ main/java/org/apache/cxf/ws/rm/feature/ main/java/org/apache/cxf/ws/rm/policy/ main/java/org/apache/cxf/ws/rm/soap/ main/java/o...
Date Tue, 04 Jun 2013 09:34:54 GMT
Author: dsosnoski
Date: Tue Jun  4 09:34:53 2013
New Revision: 1489358

URL: http://svn.apache.org/r1489358
Log:
Changes for WS-RMP 1.1 support

Added:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConfiguration.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10AssertionBuilder.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12Assertion.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12AssertionBuilder.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyUtilities.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/WSRMP12PolicyLoader.java
Modified:
    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/RMManager.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMFeatureBeanDefinitionParser.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java

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=1489358&r1=1489357&r2=1489358&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 Tue Jun  4 09:34:53 2013
@@ -41,14 +41,11 @@ import org.apache.cxf.ws.rm.manager.Acks
 import org.apache.cxf.ws.rm.manager.DeliveryAssuranceType;
 import org.apache.cxf.ws.rm.persistence.RMMessage;
 import org.apache.cxf.ws.rm.persistence.RMStore;
-import org.apache.cxf.ws.rm.policy.RM10PolicyUtils;
+import org.apache.cxf.ws.rm.policy.RMPolicyUtilities;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.AcknowledgementInterval;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.InactivityTimeout;
 
 public class DestinationSequence extends AbstractSequence {
     
@@ -177,26 +174,13 @@ public class DestinationSequence extends
             store.persistIncoming(this, msg);
         }
         
-        RMAssertion rma = RM10PolicyUtils.getRMAssertion(destination.getManager().getRMAssertion(), message);
-        long acknowledgementInterval = 0;
-        AcknowledgementInterval ai = rma.getAcknowledgementInterval();
-        if (null != ai) {
-            Long val = ai.getMilliseconds(); 
-            if (null != val) {
-                acknowledgementInterval = val.longValue();
-            }
-        }
+        RMConfiguration cfg = destination.getManager().getConfiguration();
+        cfg = RMPolicyUtilities.getRMConfiguration(cfg, message);
         
+        long acknowledgementInterval = cfg.getAcknowledgementIntervalTime();
         scheduleAcknowledgement(acknowledgementInterval);
        
-        long inactivityTimeout = 0;
-        InactivityTimeout iat = rma.getInactivityTimeout();
-        if (null != iat) {
-            Long val = iat.getMilliseconds(); 
-            if (null != val) {
-                inactivityTimeout = val.longValue();
-            }
-        }
+        long inactivityTimeout = cfg.getInactivityTimeoutTime();
         scheduleSequenceTermination(inactivityTimeout);
         
     }
@@ -253,7 +237,7 @@ public class DestinationSequence extends
      */
     boolean applyDeliveryAssurance(long mn, Message message) throws RMException {
         Continuation cont = getContinuation(message);
-        DeliveryAssuranceType da = destination.getManager().getDeliveryAssurance();
+        DeliveryAssuranceType da = destination.getManager().getConfiguration().getDeliveryAssurance();
         boolean canSkip = !da.isSetAtLeastOnce() && !da.isSetExactlyOnce();
         boolean robust = false;
         boolean robustDelivering = false;

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConfiguration.java?rev=1489358&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConfiguration.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConfiguration.java Tue Jun  4 09:34:53 2013
@@ -0,0 +1,219 @@
+/**
+ * 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.ws.rm;
+
+import org.apache.cxf.ws.rm.manager.DeliveryAssuranceType;
+import org.apache.cxf.ws.rm.manager.RM10AddressingNamespaceType;
+
+/**
+ * Configuration parameters for reliable messaging. These may be defined by a combination of Spring/Blueprint
+ * configuration with default values and WS-ReliableMessagingPolicy overrides.
+ */
+public class RMConfiguration {
+    private Long inactivityTimeout;
+    private Long acknowledgementInterval;
+    private Long baseRetransmissionInterval;
+    private boolean exponentialBackoff;
+    private boolean sequenceSTRRequired;
+    private boolean sequenceTransportSecurityRequired;
+    private boolean exactlyOnce;
+    private DeliveryAssuranceType deliveryAssurance;
+    private String rmNamespace;
+    private RM10AddressingNamespaceType rm10AddressingNamespace;
+    
+    /**
+     * Constructor just sets defaults.
+     */
+    public RMConfiguration() {
+        baseRetransmissionInterval = new Long(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL);
+        rmNamespace = RM10Constants.NAMESPACE_URI;
+    }
+    
+    /**
+     * Copy constructor.
+     * 
+     * @param base
+     */
+    public RMConfiguration(RMConfiguration base) {
+        inactivityTimeout = base.inactivityTimeout;
+        acknowledgementInterval = base.acknowledgementInterval;
+        baseRetransmissionInterval = base.baseRetransmissionInterval;
+        exponentialBackoff = base.exponentialBackoff;
+        sequenceSTRRequired = base.sequenceSTRRequired;
+        sequenceTransportSecurityRequired = base.sequenceTransportSecurityRequired;
+        deliveryAssurance = base.deliveryAssurance;
+        rmNamespace = base.rmNamespace;
+        rm10AddressingNamespace = base.rm10AddressingNamespace;
+    }
+    
+    /**
+     *  @return Returns the exactlyOnce.
+     */
+    public boolean isExactlyOnce() {
+        return exactlyOnce;
+    }
+
+    /**
+     * @param exactlyOnce The exactlyOnce to set.
+     */
+    public void setExactlyOnce(boolean exactlyOnce) {
+        this.exactlyOnce = exactlyOnce;
+    }
+
+    /**  
+     * @return Returns the deliveryAssurance.
+     */
+    public DeliveryAssuranceType getDeliveryAssurance() {
+        return deliveryAssurance;
+    }
+
+    /**
+     * @param deliveryAssurance The deliveryAssurance to set.
+     */
+    public void setDeliveryAssurance(DeliveryAssuranceType deliveryAssurance) {
+        this.deliveryAssurance = deliveryAssurance;
+    }
+
+    /**
+     * @return inactivityTimeout
+     */
+    public Long getInactivityTimeout() {
+        return inactivityTimeout;
+    }
+    
+    /**
+     * Get the number of milliseconds for the inactivity timeout.
+     * 
+     * @return milliseconds, 0 if not set
+     */
+    public long getInactivityTimeoutTime() {
+        return inactivityTimeout == null ? 0 : inactivityTimeout.longValue();
+    }
+
+    /**
+     * @param inactivityTimeout
+     */
+    public void setInactivityTimeout(Long inactivityTimeout) {
+        this.inactivityTimeout = inactivityTimeout;
+    }
+
+    /**
+     * @return acknowledgementInterval
+     */
+    public Long getAcknowledgementInterval() {
+        return acknowledgementInterval;
+    }
+    
+    /**
+     * Get the number of milliseconds for the acknowledgment interval.
+     * 
+     * @return milliseconds, 0 if not set
+     */
+    public long getAcknowledgementIntervalTime() {
+        return acknowledgementInterval == null ? 0 : acknowledgementInterval.longValue();
+    }
+
+    /**
+     * @param acknowledgementInterval
+     */
+    public void setAcknowledgementInterval(Long acknowledgementInterval) {
+        this.acknowledgementInterval = acknowledgementInterval;
+    }
+
+    /**
+     * @return baseRetransmissionInterval
+     */
+    public Long getBaseRetransmissionInterval() {
+        return baseRetransmissionInterval;
+    }
+
+    /**
+     * @param baseRetransmissionInterval
+     */
+    public void setBaseRetransmissionInterval(Long baseRetransmissionInterval) {
+        this.baseRetransmissionInterval = baseRetransmissionInterval;
+    }
+
+    /**
+     * @return exponentialBackoff
+     */
+    public boolean isExponentialBackoff() {
+        return exponentialBackoff;
+    }
+
+    /**
+     * @param exponentialBackoff
+     */
+    public void setExponentialBackoff(boolean exponentialBackoff) {
+        this.exponentialBackoff = exponentialBackoff;
+    }
+
+    /**
+     * @return sequenceSTRRequired
+     */
+    public boolean isSequenceSTRRequired() {
+        return sequenceSTRRequired;
+    }
+
+    /**
+     * @param sequenceSTRRequired
+     */
+    public void setSequenceSTRRequired(boolean sequenceSTRRequired) {
+        this.sequenceSTRRequired = sequenceSTRRequired;
+    }
+
+    /**
+     * @return sequenceTransportSecurityRequired
+     */
+    public boolean isSequenceTransportSecurityRequired() {
+        return sequenceTransportSecurityRequired;
+    }
+
+    /**
+     * @param sequenceTransportSecurityRequired
+     */
+    public void setSequenceTransportSecurityRequired(boolean sequenceTransportSecurityRequired) {
+        this.sequenceTransportSecurityRequired = sequenceTransportSecurityRequired;
+    }
+
+    public String getRMNamespace() {
+        return rmNamespace;
+    }
+
+    public void setRMNamespace(String uri) {
+        rmNamespace = uri;
+    }
+
+    public RM10AddressingNamespaceType getRM10AddressingNamespace() {
+        return rm10AddressingNamespace;
+    }
+
+    public void setRM10AddressingNamespace(RM10AddressingNamespaceType addrns) {
+        rm10AddressingNamespace = addrns;
+    }
+
+    /**
+     * @return protocol variation
+     */
+    public ProtocolVariation getConfiguredProtocol() {
+        String addrns = rm10AddressingNamespace == null ? null : rm10AddressingNamespace.getUri();
+        return ProtocolVariation.findVariant(getRMNamespace(), addrns);
+    }
+}

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=1489358&r1=1489357&r2=1489358&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 Jun  4 09:34:53 2013
@@ -59,6 +59,7 @@ import org.apache.cxf.ws.addressing.Endp
 import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.RelatesToType;
 import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl;
+import org.apache.cxf.ws.rm.manager.AcksPolicyType;
 import org.apache.cxf.ws.rm.manager.DeliveryAssuranceType;
 import org.apache.cxf.ws.rm.manager.DestinationPolicyType;
 import org.apache.cxf.ws.rm.manager.RM10AddressingNamespaceType;
@@ -71,9 +72,6 @@ import org.apache.cxf.ws.rm.v200702.Clos
 import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.BaseRetransmissionInterval;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.ExponentialBackoff;
 
 /**
  * 
@@ -105,14 +103,11 @@ public class RMManager {
     private RetransmissionQueue retransmissionQueue;
     private Map<Endpoint, RMEndpoint> reliableEndpoints = new HashMap<Endpoint, RMEndpoint>();
     private AtomicReference<Timer> timer = new AtomicReference<Timer>();
-    private RMAssertion rmAssertion;
-    private DeliveryAssuranceType deliveryAssurance;
+    private RMConfiguration configuration;
     private SourcePolicyType sourcePolicy;
     private DestinationPolicyType destinationPolicy;
     private InstrumentationManager instrumentationManager;
     private ManagedRMManager managedManager;
-    private String rmNamespace = RM10Constants.NAMESPACE_URI;
-    private RM10AddressingNamespaceType rm10AddressingNamespace;
     
     // ServerLifeCycleListener
     
@@ -131,17 +126,12 @@ public class RMManager {
             return;
         }        
         String id = RMUtils.getEndpointIdentifier(client.getEndpoint(), getBus());
-        Collection<SourceSequence> sss = store.getSourceSequences(id);
+        Collection<SourceSequence> sss = store.getSourceSequences(id/*, protocol*/);
         if (null == sss || 0 == sss.size()) {                        
             return;
         }
         LOG.log(Level.FINE, "Number of source sequences: {0}", sss.size());
-        recoverReliableEndpoint(client.getEndpoint(), client.getConduit());
-    }
-
-    private ProtocolVariation getConfiguredProtocol() {
-        String addrns = rm10AddressingNamespace == null ? null : rm10AddressingNamespace.getUri();
-        return ProtocolVariation.findVariant(getRMNamespace(), addrns);
+        recoverReliableEndpoint(client.getEndpoint(), client.getConduit()/*, protocol*/);
     }
     
     public void clientDestroyed(Client client) {
@@ -150,20 +140,14 @@ public class RMManager {
 
     // Configuration
 
-    public String getRMNamespace() {
-        return rmNamespace;
-    }
-
     public void setRMNamespace(String uri) {
-        rmNamespace = uri;
-    }
-
-    public RM10AddressingNamespaceType getRMAddressingNamespace() {
-        return rm10AddressingNamespace;
+        RMConfiguration cfg = forceConfiguration();
+        cfg.setRMNamespace(uri);
     }
 
     public void setRM10AddressingNamespace(RM10AddressingNamespaceType addrns) {
-        rm10AddressingNamespace = addrns;
+        RMConfiguration cfg = forceConfiguration();
+        cfg.setRM10AddressingNamespace(addrns);
     }
     
     public Bus getBus() {
@@ -219,19 +203,14 @@ public class RMManager {
     public BindingFaultFactory getBindingFaultFactory(Binding binding) {
         return new SoapFaultFactory(binding);
     }
-    
-    /**  
-     * @return Returns the deliveryAssurance.
-     */
-    public DeliveryAssuranceType getDeliveryAssurance() {
-        return deliveryAssurance;
-    }
 
     /**
      * @param deliveryAssurance The deliveryAssurance to set.
      */
-    public void setDeliveryAssurance(DeliveryAssuranceType deliveryAssurance) {
-        this.deliveryAssurance = deliveryAssurance;
+    public void setDeliveryAssurance(DeliveryAssuranceType da) {
+        RMConfiguration cfg = forceConfiguration();
+        cfg.setExactlyOnce(da.isSetExactlyOnce());
+        cfg.setDeliveryAssurance(da);
     }
 
     /**
@@ -248,31 +227,48 @@ public class RMManager {
         this.destinationPolicy = destinationPolicy;
     }
 
-    /** 
-     * @return Returns the rmAssertion.
+    /**
+     * @return configuration (non-<code>null</code>)
      */
-    public RMAssertion getRMAssertion() {
-        return rmAssertion;
+    public RMConfiguration getConfiguration() {
+        return configuration;
     }
 
     /**
-     * @param rma The rmAssertion to set.
+     * @param configuration (non-<code>null</code>)
      */
-    public void setRMAssertion(RMAssertion rma) {
-        if (null == rma) {
-            rma = new RMAssertion();
-            rma.setExponentialBackoff(new ExponentialBackoff());
-        }
-        BaseRetransmissionInterval bri = rma.getBaseRetransmissionInterval();
-        if (null == bri) {
-            bri = new BaseRetransmissionInterval();
-            rma.setBaseRetransmissionInterval(bri);
-        }
-        if (null == bri.getMilliseconds()) {
-            bri.setMilliseconds(Long.valueOf(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL));
+    public void setConfiguration(RMConfiguration configuration) {
+        this.configuration = configuration;
+    }
+    
+    RMConfiguration forceConfiguration() {
+        if (configuration == null) {
+            configuration = new RMConfiguration();
         }
+        return configuration;
+    }
 
-        rmAssertion = rma;
+    /**
+     * @param rma The rmAssertion to set.
+     */
+    public void setRMAssertion(org.apache.cxf.ws.rmp.v200502.RMAssertion rma) {
+        RMConfiguration cfg = forceConfiguration();
+        cfg.setExponentialBackoff(rma.getExponentialBackoff() != null);
+        org.apache.cxf.ws.rmp.v200502.RMAssertion.InactivityTimeout inactTimeout
+            = rma.getInactivityTimeout();
+        if (inactTimeout != null) {
+            cfg.setInactivityTimeout(inactTimeout.getMilliseconds());
+        }
+        org.apache.cxf.ws.rmp.v200502.RMAssertion.BaseRetransmissionInterval bri
+            = rma.getBaseRetransmissionInterval();
+        if (bri != null) {
+            cfg.setBaseRetransmissionInterval(bri.getMilliseconds());
+        }
+        org.apache.cxf.ws.rmp.v200502.RMAssertion.AcknowledgementInterval ackInterval
+            = rma.getAcknowledgementInterval();
+        if (ackInterval != null) {
+            cfg.setAcknowledgementInterval(ackInterval.getMilliseconds());
+        }
     }
 
     /** 
@@ -353,7 +349,7 @@ public class RMManager {
                 addrUri = maps.getNamespaceURI();
             }
             if (addrUri == null) {
-                addrUri = getConfiguredProtocol().getWSANamespace();
+                addrUri = configuration.getConfiguredProtocol().getWSANamespace();
             }
         }
         return addrUri;
@@ -374,7 +370,7 @@ public class RMManager {
                 rmUri = rmps.getNamespaceURI();
             }
             if (rmUri == null) {
-                rmUri = getRMNamespace();
+                rmUri = configuration.getRMNamespace();
             }
         }
         return rmUri;
@@ -410,7 +406,7 @@ public class RMManager {
             RelatesToType relatesTo = null;
             if (isServer) {
                 AddressingProperties inMaps = RMContextUtils.retrieveMAPs(message, false, false);
-                inMaps.exposeAs(getConfiguredProtocol().getWSANamespace());
+                inMaps.exposeAs(configuration.getConfiguredProtocol().getWSANamespace());
                 acksTo = RMUtils.createReference(inMaps.getTo().getValue());
                 to = inMaps.getReplyTo();
                 source.getReliableEndpoint().getServant().setUnattachedIdentifier(inSeqId);
@@ -610,29 +606,29 @@ public class RMManager {
     
     @PostConstruct
     void initialise() {
-        if (null == rmAssertion) {
-            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) {
-            da.setAtLeastOnce(factory.createDeliveryAssuranceTypeAtLeastOnce());
-            setDeliveryAssurance(da);
+        if (configuration == null) {
+            configuration = new RMConfiguration();
+            configuration.setExponentialBackoff(true);
+        }
+        DeliveryAssuranceType deliveryAssurance = configuration.getDeliveryAssurance();
+        if (deliveryAssurance == null) {
+            DeliveryAssuranceType da = new DeliveryAssuranceType();
+            da.setAtLeastOnce(new DeliveryAssuranceType.AtLeastOnce());
+            configuration.setDeliveryAssurance(da);
         } else if (deliveryAssurance.getExactlyOnce() != null) {
             if (deliveryAssurance.getAtMostOnce() == null) {
-                deliveryAssurance.setAtMostOnce(factory.createDeliveryAssuranceTypeAtMostOnce());
+                deliveryAssurance.setAtMostOnce(new DeliveryAssuranceType.AtMostOnce());
             }
             if (deliveryAssurance.getAtLeastOnce() == null) {
-                deliveryAssurance.setAtLeastOnce(factory.createDeliveryAssuranceTypeAtLeastOnce());
+                deliveryAssurance.setAtLeastOnce(new DeliveryAssuranceType.AtLeastOnce());
             }
         }
         if (null == sourcePolicy) {
             setSourcePolicy(null);
-
         }       
         if (null == destinationPolicy) {
-            DestinationPolicyType dp = factory.createDestinationPolicyType();
-            dp.setAcksPolicy(factory.createAcksPolicyType());
+            DestinationPolicyType dp = new DestinationPolicyType();
+            dp.setAcksPolicy(new AcksPolicyType());
             setDestinationPolicy(dp);
         }
         if (null == retransmissionQueue) {

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java Tue Jun  4 09:34:53 2013
@@ -70,10 +70,11 @@ public class RMBPBeanDefinitionParser ex
                 new QName("http://schemas.xmlsoap.org/ws/2005/02/rm/policy", "RMAssertion"), 
                 "RMAssertion",
                 org.apache.cxf.ws.rmp.v200502.RMAssertion.class);
-        mapElementToJaxbProperty(context, bean, element,
-                new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"), 
-                "RMAssertion",
-                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
+        // TODO: handle
+//        mapElementToJaxbProperty(context, bean, element,
+//                new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"), 
+//                "RMAssertion",
+//                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
 
         parseAttributes(element, context, bean);
         parseChildElements(element, context, bean);

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/RMFeature.java Tue Jun  4 09:34:53 2013
@@ -92,7 +92,7 @@ public class RMFeature extends AbstractF
             manager.setRMAssertion(rmAssertion);
         }
         if (null != deliveryAssurance) {
-            manager.setDeliveryAssurance(deliveryAssurance);
+            manager.getConfiguration().setDeliveryAssurance(deliveryAssurance);
         }
         if (null != sourcePolicy) {
             manager.setSourcePolicy(sourcePolicy);
@@ -104,10 +104,10 @@ public class RMFeature extends AbstractF
             manager.setStore(store);
         }
         if (null != rmNamespace) {
-            manager.setRMNamespace(rmNamespace);
+            manager.getConfiguration().setRMNamespace(rmNamespace);
         }
         if (null != rm10AddressingNamespace) {
-            manager.setRM10AddressingNamespace(rm10AddressingNamespace);
+            manager.getConfiguration().setRM10AddressingNamespace(rm10AddressingNamespace);
         }
 
         rmLogicalIn.setBus(bus);

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10AssertionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10AssertionBuilder.java?rev=1489358&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10AssertionBuilder.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10AssertionBuilder.java Tue Jun  4 09:34:53 2013
@@ -0,0 +1,82 @@
+/**
+ * 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.ws.rm.policy;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion;
+import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder;
+import org.apache.cxf.ws.rm.RM11Constants;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.Constants;
+import org.apache.neethi.PolicyComponent;
+
+/**
+ * Policy assertion builder for WS-RMP 1.0 (submission). Since this version of WS-RMP nests everything as
+ * direct child elements of the RMAssertion JAXB can be used directly to convert to/from XML.
+ */
+public class RM10AssertionBuilder extends JaxbAssertionBuilder<RMAssertion> {
+    public static final List<QName> KNOWN_ELEMENTS 
+        = Collections.singletonList(RM11Constants.WSRMP_RMASSERTION_QNAME);
+
+    public RM10AssertionBuilder() throws JAXBException {
+        super(RMAssertion.class, RM11Constants.WSRMP_RMASSERTION_QNAME);     
+    }
+
+    @Override
+    protected JaxbAssertion<RMAssertion> buildAssertion() {
+        return new RMPolicyAssertion();
+    }
+    
+    class RMPolicyAssertion extends JaxbAssertion<RMAssertion> {
+        RMPolicyAssertion() {
+            super(RM11Constants.WSRMP_RMASSERTION_QNAME, false);
+        }
+        RMPolicyAssertion(boolean opt) {
+            super(RM11Constants.WSRMP_RMASSERTION_QNAME, opt);
+        }
+        RMPolicyAssertion(boolean opt, boolean ignore) {
+            super(RM11Constants.WSRMP_RMASSERTION_QNAME, opt, ignore);
+        }
+
+        @Override
+        public boolean equal(PolicyComponent policyComponent) {
+            if (policyComponent.getType() != Constants.TYPE_ASSERTION
+                || !getName().equals(((Assertion)policyComponent).getName())) {
+                return false;
+            }
+            JaxbAssertion<RMAssertion> other = 
+                    JaxbAssertion.cast((Assertion)policyComponent);            
+            return RM10PolicyUtils.equals(this.getData(), other.getData());  
+        }
+        
+        @Override
+        protected Assertion clone(boolean b) {
+            RMPolicyAssertion a = new RMPolicyAssertion();
+            a.setData(getData());
+            return a;        
+        }
+    }
+}

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12Assertion.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12Assertion.java?rev=1489358&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12Assertion.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12Assertion.java Tue Jun  4 09:34:53 2013
@@ -0,0 +1,182 @@
+/**
+ * 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.ws.rm.policy;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.cxf.ws.rm.RM11Constants;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.PolicyComponent;
+
+/**
+ * Representation of WS-RMP 1.2 assertion data.
+ */
+public class RM12Assertion implements Assertion {
+    public static final String POLICY_NS = "http://www.w3.org/ns/ws-policy";
+    public static final String POLICY_LOCAL = "Policy";
+    public static final String POLICY_PREFIX = "wsp";
+    
+    public static final String SEQUENCESTR_NAME = "SequenceSTR";
+    public static final String SEQUENCETRANSEC_NAME = "SequenceTransportSecurity";
+    public static final String DELIVERYASSURANCE_NAME = "DeliveryAssurance";
+    public static final String INORDER_NAME = "InOrder";
+    
+    enum Order {
+        ExactlyOnce, AtLeastOnce, AtMostOnce
+    };
+
+    private boolean isOptional;
+    private boolean ignorable;
+    private boolean normalized;
+    private boolean isSequenceSTR;
+    private boolean isSequenceTransportSecurity;
+    private Order order;
+    private boolean inOrder;
+
+    public QName getName() {
+        return RM11Constants.WSRMP_RMASSERTION_QNAME;
+    }
+
+    public boolean isOptional() {
+        return isOptional;
+    }
+
+    public void setOptional(boolean optional) {
+        this.isOptional = optional;
+    }
+    
+    public boolean isIgnorable() {
+        return ignorable;
+    }
+
+    public void setIgnorable(boolean ignorable) {
+        this.ignorable = ignorable;
+    }
+
+    public boolean isSequenceSTR() {
+        return isSequenceSTR;
+    }
+
+    public void setSequenceSTR(boolean str) {
+        isSequenceSTR = str;
+    }
+
+    public boolean isSequenceTransportSecurity() {
+        return isSequenceTransportSecurity;
+    }
+
+    public void setSequenceTransportSecurity(boolean sts) {
+        isSequenceTransportSecurity = sts;
+    }
+
+    public Order getOrder() {
+        return order;
+    }
+
+    public void setOrder(Order order) {
+        this.order = order;
+    }
+
+    public boolean isInOrder() {
+        return inOrder;
+    }
+
+    public void setInOrder(boolean inOrder) {
+        this.inOrder = inOrder;
+    }
+
+    public short getType() {
+        return org.apache.neethi.Constants.TYPE_ASSERTION;
+    }
+
+    public boolean equal(PolicyComponent policyComponent) {
+        return policyComponent == this;
+    }
+
+    public void setNormalized(boolean normalized) {
+        this.normalized = normalized;
+    }
+
+    public boolean isNormalized() {
+        return normalized;
+    }
+    
+    public boolean isAssuranceSet() {
+        return order != null || inOrder;
+    }
+
+    public PolicyComponent normalize() {
+        return this;
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+
+        String localName = RM11Constants.RMASSERTION_NAME;
+        String namespaceURI = RM11Constants.WSRMP_NAMESPACE_URI;
+        String prefix = writer.getPrefix(namespaceURI);
+        if (prefix == null) {
+            prefix = "rmp12";
+            writer.setPrefix(prefix, namespaceURI);
+        }
+
+        // <rmp12:RMAssertion>
+        writer.writeStartElement(prefix, localName, namespaceURI);
+        String wspPrefix = writer.getPrefix(POLICY_NS);
+        if (wspPrefix == null) {
+            wspPrefix = POLICY_PREFIX;
+            writer.setPrefix(wspPrefix, POLICY_NS);
+        }
+
+        // <wsp:Policy>
+        writer.writeStartElement(wspPrefix, POLICY_LOCAL, POLICY_NS);
+        
+        // <rmp12:SequenceSTR>
+        if (isSequenceSTR) {
+            writer.writeEmptyElement(prefix, SEQUENCESTR_NAME, namespaceURI);
+        }
+        
+        // <rmp12:SequenceTransportSecurity>
+        if (isSequenceTransportSecurity) {
+            writer.writeEmptyElement(prefix, SEQUENCETRANSEC_NAME, namespaceURI);
+        }
+        
+        // <rmp12:DeliveryAssurance> <wsp:Policy> ... </wsp:Policy> </rmp12:DeliveryAssurance>
+        if (isAssuranceSet()) {
+            writer.writeStartElement(prefix, DELIVERYASSURANCE_NAME, namespaceURI);
+            writer.writeStartElement(wspPrefix, POLICY_LOCAL, POLICY_NS);
+            if (order != null) {
+                writer.writeEmptyElement(prefix, order.name(), namespaceURI);
+            }
+            if (inOrder) {
+                writer.writeEmptyElement(prefix, INORDER_NAME, namespaceURI);
+            }
+            writer.writeEndElement();
+            writer.writeEndElement();
+        }
+
+        // </wsp:Policy>
+        writer.writeEndElement();
+
+        // </rmp12:RMAssertion>
+        writer.writeEndElement();
+    }
+}
\ No newline at end of file

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12AssertionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12AssertionBuilder.java?rev=1489358&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12AssertionBuilder.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM12AssertionBuilder.java Tue Jun  4 09:34:53 2013
@@ -0,0 +1,105 @@
+/**
+ * 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.ws.rm.policy;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.ws.policy.PolicyConstants;
+import org.apache.cxf.ws.rm.RM11Constants;
+import org.apache.cxf.ws.rm.policy.RM12Assertion.Order;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
+import org.apache.neethi.Constants;
+import org.apache.neethi.builders.AssertionBuilder;
+
+/**
+ * Builds a WS-RMP 1.2 assertion from the raw XML. Unlike WS-RMP 1.0, in WS-RMP 1.2 the actual assertions are
+ * nested within layers of <wsp:Policy> operators so need to be handled directly (not by JAXB).
+ */
+public class RM12AssertionBuilder implements AssertionBuilder<Element> {
+    
+    /**
+     * @see org.apache.neethi.builders.AssertionBuilder#getKnownElements()
+     */
+    public QName[] getKnownElements() {
+        return new QName[] {RM11Constants.WSRMP_RMASSERTION_QNAME};
+    }
+    
+    /**
+     * @see org.apache.neethi.builders.AssertionBuilder#build(java.lang.Object,
+     *  org.apache.neethi.AssertionBuilderFactory)
+     */
+    public Assertion build(Element element, AssertionBuilderFactory factory) throws IllegalArgumentException {
+        
+        RM12Assertion assertion = new RM12Assertion();
+        assertion.setOptional(PolicyConstants.isOptional(element));
+        assertion.setIgnorable(PolicyConstants.isIgnorable(element));
+        
+        // dig into the nested structure to set property values
+        Element elem = DOMUtils.getFirstElement(element);
+        while (elem != null) {
+            if (DOMUtils.getFirstChildWithName(elem, 
+                RM11Constants.WSRMP_NAMESPACE_URI, RM12Assertion.DELIVERYASSURANCE_NAME) != null) {
+                
+                // find nested policy and definitions within (note this won't handle nested policy operators)
+                Element childEl = DOMUtils.getFirstElement(elem);
+                while (childEl != null) {
+                    if (Constants.isPolicyElement(childEl.getNamespaceURI(), childEl.getLocalName())) {
+                        handlePolicy(childEl, assertion);
+                    }
+                }
+
+            } else if (DOMUtils.getFirstChildWithName(elem, 
+                RM11Constants.WSRMP_NAMESPACE_URI, RM12Assertion.SEQUENCESTR_NAME) != null) {
+                assertion.setSequenceSTR(true);
+            } else if (DOMUtils.getFirstChildWithName(elem, 
+                RM11Constants.WSRMP_NAMESPACE_URI, RM12Assertion.SEQUENCETRANSEC_NAME) != null) {
+                assertion.setSequenceTransportSecurity(true);              
+            }
+            elem = DOMUtils.getNextElement(elem);
+        }
+
+        return assertion;
+    }
+
+    /**
+     * @param childEl
+     * @param assertion
+     */
+    private void handlePolicy(Element childEl, RM12Assertion assertion) {
+        
+        // don't check for conflicts or repeats, just use the last values supplied
+        Element innerEl = DOMUtils.getFirstElement(childEl);
+        if (RM11Constants.WSRMP_NAMESPACE_URI.equals(innerEl.getNamespaceURI())) {
+            String lname = innerEl.getLocalName();
+            if (RM12Assertion.INORDER_NAME.equals(lname)) {
+                assertion.setInOrder(true);
+            } else {
+                Order order = RM12Assertion.Order.valueOf(lname);
+                if (order != null) {
+                    assertion.setOrder(order);
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyUtilities.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyUtilities.java?rev=1489358&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyUtilities.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyUtilities.java Tue Jun  4 09:34:53 2013
@@ -0,0 +1,329 @@
+/**
+ * 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.ws.rm.policy;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.ws.policy.AssertionInfo;
+import org.apache.cxf.ws.policy.AssertionInfoMap;
+import org.apache.cxf.ws.rm.RM10Constants;
+import org.apache.cxf.ws.rm.RM11Constants;
+import org.apache.cxf.ws.rm.RMConfiguration;
+import org.apache.cxf.ws.rm.manager.DeliveryAssuranceType;
+import org.apache.cxf.ws.rm.policy.RM12Assertion.Order;
+import org.apache.cxf.ws.rmp.v200502.RMAssertion;
+
+/**
+ * Policy assertion builder for WS-RMP 1.0 (submission). Since this version of WS-RMP nests everything as
+ * direct child elements of the RMAssertion JAXB can be used directly to convert to/from XML.
+ */
+public final class RMPolicyUtilities {
+    
+    private RMPolicyUtilities() {
+    }
+    
+    /**
+     * Returns an RMAssertion that is compatible with the default value
+     * and all RMAssertions pertaining to the message (can never be null).
+     * 
+     * @param rma the default value (non-<code>null</code>)
+     * @param message the message
+     * @return the compatible RMAssertion
+     */
+    public static RMConfiguration getRMConfiguration(RMConfiguration defaultValue, Message message) {
+        RMConfiguration compatible = defaultValue;
+        Collection<AssertionInfo> ais = collectRMAssertions(message.get(AssertionInfoMap.class));
+        for (AssertionInfo ai : ais) {
+            if (ai.getAssertion() instanceof RM10AssertionBuilder.RMPolicyAssertion) {
+                RMAssertion rma = ((RM10AssertionBuilder.RMPolicyAssertion)ai.getAssertion()).getData();
+                compatible = intersect(rma, compatible);
+            } else if (ai.getAssertion() instanceof RM12Assertion) {
+                RM12Assertion rma = (RM12Assertion) ai.getAssertion();
+                compatible = intersect(rma, compatible);
+            }
+        }
+        return compatible;
+    }
+
+    /**
+     * Collect RMAssertions from map. This checks both namespaces defined for WS-RM policy assertions.
+     * 
+     * @param aim map, may be <code>null</code>
+     * @return merged collection, never <code>null</code>
+     */
+    public static Collection<AssertionInfo> collectRMAssertions(AssertionInfoMap aim) {
+        Collection<AssertionInfo> mergedAsserts = new ArrayList<AssertionInfo>();
+        if (aim != null) {
+            Collection<AssertionInfo> ais = aim.get(RM10Constants.WSRMP_RMASSERTION_QNAME);
+            if (ais != null) {
+                mergedAsserts.addAll(ais);
+            }
+            ais = aim.get(RM11Constants.WSRMP_RMASSERTION_QNAME);
+            if (ais != null) {
+                mergedAsserts.addAll(ais);
+            }
+        }
+        return mergedAsserts;
+    }
+
+    static boolean equalLongs(Long aval, Long bval) {
+        if (null != aval) {
+            return aval.equals(bval);
+        } else {
+            return false;
+        }
+    }
+    
+    public static boolean equals(RMAssertion a, RMAssertion b) {
+        if (a == b) {
+            return true;
+        }
+        
+        Long aval = null;
+        if (null != a.getInactivityTimeout()) {
+            aval = a.getInactivityTimeout().getMilliseconds();
+        }
+        Long bval = null;
+        if (null != b.getInactivityTimeout()) {
+            bval = b.getInactivityTimeout().getMilliseconds();            
+        }
+        if (!equalLongs(aval, bval)) {
+            return false;
+        }
+            
+        aval = null;
+        if (null != a.getBaseRetransmissionInterval()) {
+            aval = a.getBaseRetransmissionInterval().getMilliseconds();
+        }
+        bval = null;
+        if (null != b.getBaseRetransmissionInterval()) {
+            bval = b.getBaseRetransmissionInterval().getMilliseconds();            
+        }
+        if (!equalLongs(aval, bval)) {
+            return false;
+        }
+        
+        aval = null;
+        if (null != a.getAcknowledgementInterval()) {
+            aval = a.getAcknowledgementInterval().getMilliseconds();
+        }
+        bval = null;
+        if (null != b.getAcknowledgementInterval()) {
+            bval = b.getAcknowledgementInterval().getMilliseconds(); 
+        }
+        if (!equalLongs(aval, bval)) {
+            return false;
+        }
+        
+        return null == a.getExponentialBackoff()
+            ? null == b.getExponentialBackoff() 
+            : null != b.getExponentialBackoff();         
+    }
+    
+    /**
+     * Intersect a policy with a supplied configuration.
+     * 
+     * @param rma
+     * @param cfg
+     * @return result configuration
+     */
+    public static RMConfiguration intersect(RMAssertion rma, RMConfiguration cfg) {
+        if (isCompatible(rma, cfg)) {
+            return cfg;
+        }
+        
+        RMConfiguration compatible = new RMConfiguration();
+        
+        // if supplied, policy value overrides default inactivity timeout
+        Long aval = cfg.getInactivityTimeout();
+        Long bval = null;
+        if (null != rma.getInactivityTimeout()) {
+            bval = rma.getInactivityTimeout().getMilliseconds();            
+        }
+        if (null != aval || null != bval) {
+            Long use;
+            if (bval != null) {
+                use = bval;
+            } else {
+                use = aval;
+            }
+            compatible.setInactivityTimeout(use);
+        }
+        
+        // if supplied, policy value overrides base retransmission interval
+        aval = cfg.getBaseRetransmissionInterval();
+        bval = null;
+        if (null != rma.getBaseRetransmissionInterval()) {
+            bval = rma.getBaseRetransmissionInterval().getMilliseconds();            
+        }
+        if (null != aval || null != bval) {
+            Long use;
+            if (bval != null) {
+                use = bval;
+            } else {
+                use = aval;
+            }
+            compatible.setBaseRetransmissionInterval(use);
+        }
+        
+        // if supplied, policy value overrides acknowledgement interval
+        aval = cfg.getAcknowledgementInterval();
+        bval = null;
+        if (null != rma.getAcknowledgementInterval()) {
+            bval = rma.getAcknowledgementInterval().getMilliseconds(); 
+        }
+        if (null != aval || null != bval) {
+            Long use;
+            if (bval != null) {
+                use = bval;
+            } else {
+                use = aval;
+            }
+            compatible.setAcknowledgementInterval(use);
+        }
+    
+        // backoff parameter
+        if (cfg.isExponentialBackoff() || null != rma.getExponentialBackoff()) {
+            compatible.setExponentialBackoff(true);
+        }
+        return compatible;
+    }
+    
+    /**
+     * Check if a policy is compatible with a supplied configuration.
+     * 
+     * @param asser
+     * @param cfg
+     * @return <code>true</code> if compatible, <code>false</code> if not
+     */
+    public static boolean isCompatible(RMAssertion asser, RMConfiguration cfg) {
+        Long aval = null;
+        if (null != asser.getInactivityTimeout()) {
+            aval = asser.getInactivityTimeout().getMilliseconds();            
+        }
+        if (!equalLongs(cfg.getInactivityTimeout(), aval)) {
+            return false;
+        }
+            
+        aval = null;
+        if (null != asser.getBaseRetransmissionInterval()) {
+            aval = asser.getBaseRetransmissionInterval().getMilliseconds();            
+        }
+        if (!equalLongs(cfg.getBaseRetransmissionInterval(), aval)) {
+            return false;
+        }
+        
+        aval = null;
+        if (null != asser.getAcknowledgementInterval()) {
+            aval = asser.getAcknowledgementInterval().getMilliseconds(); 
+        }
+        if (!equalLongs(cfg.getAcknowledgementInterval(), aval)) {
+            return false;
+        }
+        
+        return cfg.isExponentialBackoff()
+            ? null == asser.getExponentialBackoff() 
+            : null != asser.getExponentialBackoff();         
+    }
+    
+    /**
+     * Intersect a policy with a supplied configuration.
+     * 
+     * @param rma
+     * @param cfg
+     * @return result configuration
+     */
+    public static RMConfiguration intersect(RM12Assertion rma, RMConfiguration cfg) {
+        if (isCompatible(rma, cfg)) {
+            return cfg;
+        }
+        RMConfiguration compatible = new RMConfiguration(cfg);
+        
+        // policy values override supplied settings
+        if (rma.isSequenceSTR()) {
+            compatible.setSequenceSTRRequired(true);
+        }
+        if (rma.isSequenceTransportSecurity()) {
+            compatible.setSequenceTransportSecurityRequired(true);
+        }
+        if (rma.isAssuranceSet()) {
+            DeliveryAssuranceType assurance = compatible.getDeliveryAssurance();
+            if (assurance == null) {
+                assurance = new DeliveryAssuranceType();
+            }
+            if (rma.isInOrder()) {
+                assurance.setInOrder(new DeliveryAssuranceType.InOrder());
+            }
+            Order order = rma.getOrder();
+            if (order != null) {
+                switch (order) {
+                case AtLeastOnce:
+                    assurance.setAtLeastOnce(new DeliveryAssuranceType.AtLeastOnce());
+                    break;
+                case AtMostOnce:
+                    assurance.setAtMostOnce(new DeliveryAssuranceType.AtMostOnce());
+                    break;
+                case ExactlyOnce:
+                    assurance.setExactlyOnce(new DeliveryAssuranceType.ExactlyOnce());
+                    break;
+                default:
+                    // unreachable code, required by checkstyle
+                    break;
+                }
+            }
+        }
+        return compatible;
+    }
+    
+    /**
+     * Check if a policy is compatible with a supplied configuration.
+     * 
+     * @param rma
+     * @param cfg
+     * @return <code>true</code> if compatible, <code>false</code> if not
+     */
+    public static boolean isCompatible(RM12Assertion rma, RMConfiguration cfg) {
+        if ((rma.isSequenceSTR() && !cfg.isSequenceSTRRequired())
+            || (rma.isSequenceTransportSecurity() && !cfg.isSequenceTransportSecurityRequired())) {
+            return false;
+        }
+        DeliveryAssuranceType assurance = cfg.getDeliveryAssurance();
+        if (rma.isInOrder() && (assurance == null || assurance.getInOrder() == null)) {
+            return false;
+        }
+        Order order = rma.getOrder();
+        if (order != null) {
+            switch (order) {
+            case AtLeastOnce:
+                return assurance.isSetAtLeastOnce();
+            case AtMostOnce:
+                return assurance.isSetAtMostOnce();
+            case ExactlyOnce:
+                return assurance.isSetExactlyOnce();
+            default:
+                // unreachable code, required by checkstyle
+                break;
+            }
+        }
+        return true;
+    }
+}
\ No newline at end of file

Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/WSRMP12PolicyLoader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/WSRMP12PolicyLoader.java?rev=1489358&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/WSRMP12PolicyLoader.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/WSRMP12PolicyLoader.java Tue Jun  4 09:34:53 2013
@@ -0,0 +1,64 @@
+/**
+ * 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.ws.rm.policy;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.ws.policy.AssertionBuilderLoader;
+import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
+import org.apache.cxf.ws.policy.PolicyInterceptorProviderLoader;
+import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry;
+
+/**
+ * Policy loader for WS-RMP 1.2. This provides the hooks for Neethi to handle the WS-RMP 1.2 policy
+ * assertions.
+ */
+@NoJSR250Annotations
+public final class WSRMP12PolicyLoader implements PolicyInterceptorProviderLoader, AssertionBuilderLoader {
+    Bus bus;
+    
+    public WSRMP12PolicyLoader(Bus b) {
+        bus = b;
+        registerBuilders();
+        try {
+            registerProviders();
+        } catch (Throwable t) {
+            // We'll ignore this as the policy framework will then not find the providers and error out at
+            // that point. If nothing uses WS-RMP 1.2 no warnings/errors will display
+        }
+    }
+    
+    public void registerBuilders() {
+        AssertionBuilderRegistry reg = bus.getExtension(AssertionBuilderRegistry.class);
+        if (reg == null) {
+            return;
+        }
+        reg.registerBuilder(new RM12AssertionBuilder());
+    }
+    
+    public void registerProviders() {
+        //interceptor provider for the policy
+        PolicyInterceptorProviderRegistry reg = bus.getExtension(PolicyInterceptorProviderRegistry.class);
+        if (reg == null) {
+            return;
+        }
+        reg.register(new RMPolicyInterceptorProvider(bus));
+    }
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java Tue Jun  4 09:34:53 2013
@@ -56,6 +56,7 @@ import org.apache.cxf.ws.addressing.Endp
 import org.apache.cxf.ws.policy.AssertionInfo;
 import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion;
 import org.apache.cxf.ws.rm.ProtocolVariation;
+import org.apache.cxf.ws.rm.RMConfiguration;
 import org.apache.cxf.ws.rm.RMContextUtils;
 import org.apache.cxf.ws.rm.RMException;
 import org.apache.cxf.ws.rm.RMManager;
@@ -68,7 +69,7 @@ import org.apache.cxf.ws.rm.RetryStatus;
 import org.apache.cxf.ws.rm.SourceSequence;
 import org.apache.cxf.ws.rm.manager.RetryPolicyType;
 import org.apache.cxf.ws.rm.persistence.RMStore;
-import org.apache.cxf.ws.rm.policy.RM10PolicyUtils;
+import org.apache.cxf.ws.rm.policy.RMPolicyUtilities;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
 import org.apache.cxf.ws.rmp.v200502.RMAssertion;
@@ -504,12 +505,10 @@ public class RetransmissionQueueImpl imp
             message = m;
             retries = 0;
             out = m.getContent(OutputStream.class);
-            org.apache.cxf.ws.rmp.v200502.RMAssertion rma = 
-                RM10PolicyUtils.getRMAssertion(manager.getRMAssertion(), message);
+            RMConfiguration cfg = RMPolicyUtilities.getRMConfiguration(manager.getConfiguration(), message);
             long baseRetransmissionInterval = 
-                rma.getBaseRetransmissionInterval().getMilliseconds().longValue();
-            backoff = null != rma.getExponentialBackoff() 
-                ? RetransmissionQueue.DEFAULT_EXPONENTIAL_BACKOFF : 1;
+                cfg.getBaseRetransmissionInterval().longValue();
+            backoff = cfg.isExponentialBackoff()  ? RetransmissionQueue.DEFAULT_EXPONENTIAL_BACKOFF : 1;
             next = new Date(System.currentTimeMillis() + baseRetransmissionInterval);
             nextInterval = baseRetransmissionInterval * backoff;
             RetryPolicyType rmrp = null != manager.getSourcePolicy() 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMFeatureBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMFeatureBeanDefinitionParser.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMFeatureBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMFeatureBeanDefinitionParser.java Tue Jun  4 09:34:53 2013
@@ -46,10 +46,11 @@ public class RMFeatureBeanDefinitionPars
                 new QName("http://schemas.xmlsoap.org/ws/2005/02/rm/policy", "RMAssertion"), 
                 "RMAssertion",
                 org.apache.cxf.ws.rmp.v200502.RMAssertion.class);
-        mapElementToJaxbProperty(element, bean, 
-                new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"), 
-                "RMAssertion",
-                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
+        // TODO: handle
+//        mapElementToJaxbProperty(element, bean, 
+//                new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"), 
+//                "RMAssertion",
+//                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
         
         super.parseChildElements(element, ctx, bean);                
         ctx.getDelegate().parsePropertyElements(element, bean.getBeanDefinition());

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java Tue Jun  4 09:34:53 2013
@@ -47,10 +47,11 @@ public class RMManagerBeanDefinitionPars
                 new QName("http://schemas.xmlsoap.org/ws/2005/02/rm/policy", "RMAssertion"), 
                 "RMAssertion",
                 org.apache.cxf.ws.rmp.v200502.RMAssertion.class);
-        mapElementToJaxbProperty(element, bean, 
-                new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"), 
-                "RMAssertion",
-                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
+        // TODO: handle
+//        mapElementToJaxbProperty(element, bean, 
+//                new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"), 
+//                "RMAssertion",
+//                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
         
         ctx.getDelegate().parsePropertyElements(element, bean.getBeanDefinition());
         

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java Tue Jun  4 09:34:53 2013
@@ -38,12 +38,9 @@ import org.apache.cxf.ws.rm.v200702.Obje
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.AcknowledgementInterval;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.BaseRetransmissionInterval;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion.InactivityTimeout;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
+
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -57,7 +54,7 @@ public class DestinationSequenceTest ext
     private EndpointReferenceType ref;
     private Destination destination;
     private RMManager manager;
-    private RMAssertion rma;
+    private RMConfiguration config;
     private AcksPolicyType ap;
     private DestinationPolicyType dp;
  
@@ -76,7 +73,7 @@ public class DestinationSequenceTest ext
         ref = null;
         destination = null;
         manager = null;
-        rma = null;
+        config = null;
         dp = null;
         ap = null;
         
@@ -426,10 +423,7 @@ public class DestinationSequenceTest ext
         control.replay();
         
         ap.setIntraMessageThreshold(0);
-        AcknowledgementInterval ai = new org.apache.cxf.ws.rmp.v200502.ObjectFactory()
-            .createRMAssertionAcknowledgementInterval();
-        ai.setMilliseconds(new Long(200));
-        rma.setAcknowledgementInterval(ai);        
+        config.setAcknowledgementInterval(new Long(200));        
 
         assertTrue(!seq.sendAcknowledgement());   
               
@@ -473,9 +467,9 @@ public class DestinationSequenceTest ext
         List<AcknowledgementRange> ranges = new ArrayList<AcknowledgementRange>();
         AcknowledgementRange r = control.createMock(AcknowledgementRange.class);
         EasyMock.expect(ack.getAcknowledgementRange()).andReturn(ranges);
-        DeliveryAssuranceType da = control.createMock(DeliveryAssuranceType.class);
-        EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da);
-        EasyMock.expect(da.isSetAtMostOnce()).andReturn(true);                    
+        DeliveryAssuranceType assure = new DeliveryAssuranceType();
+        assure.setAtMostOnce(new DeliveryAssuranceType.AtMostOnce());
+        config.setDeliveryAssurance(assure);
         
         control.replay();        
         DestinationSequence ds = new DestinationSequence(id, ref, 0, ack, ProtocolVariation.RM10WSA200408);
@@ -486,8 +480,7 @@ public class DestinationSequenceTest ext
         control.reset();
         ranges.add(r);
         EasyMock.expect(destination.getManager()).andReturn(manager);
-        EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da);
-        EasyMock.expect(da.isSetAtMostOnce()).andReturn(true);            
+        EasyMock.expect(manager.getConfiguration()).andReturn(config);
         EasyMock.expect(ack.getAcknowledgementRange()).andReturn(ranges);
         EasyMock.expect(r.getLower()).andReturn(new Long(5));
         EasyMock.expect(r.getUpper()).andReturn(new Long(15));
@@ -511,11 +504,9 @@ public class DestinationSequenceTest ext
             messages[i] = setUpMessage(Integer.toString(i + 1));                                           
         }
         
-        DeliveryAssuranceType da = control.createMock(DeliveryAssuranceType.class);
-        EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da).anyTimes();
-        EasyMock.expect(da.isSetAtMostOnce()).andReturn(false).anyTimes();
-        EasyMock.expect(da.isSetAtLeastOnce()).andReturn(true).anyTimes();
-        EasyMock.expect(da.isSetInOrder()).andReturn(true).anyTimes(); 
+        DeliveryAssuranceType assure = new DeliveryAssuranceType();
+        assure.setAtLeastOnce(new DeliveryAssuranceType.AtLeastOnce());
+        config.setDeliveryAssurance(assure);
         
         SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
         List<AcknowledgementRange> ranges = new ArrayList<AcknowledgementRange>();
@@ -594,9 +585,7 @@ public class DestinationSequenceTest ext
         EasyMock.expect(rme.getLastApplicationMessage()).andReturn(arrival);
 
         control.replay();
-        InactivityTimeout iat = new RMAssertion.InactivityTimeout();
-        iat.setMilliseconds(new Long(200));
-        rma.setInactivityTimeout(iat); 
+        config.setInactivityTimeout(new Long(200)); 
         
         seq.acknowledge(message);
         
@@ -734,15 +723,10 @@ public class DestinationSequenceTest ext
         ap = cfgFactory.createAcksPolicyType();
         dp.setAcksPolicy(ap);
         
-        org.apache.cxf.ws.rmp.v200502.ObjectFactory policyFactory =
-            new org.apache.cxf.ws.rmp.v200502.ObjectFactory();
-        rma = policyFactory.createRMAssertion();
-        BaseRetransmissionInterval bri =
-            policyFactory.createRMAssertionBaseRetransmissionInterval();
-        bri.setMilliseconds(new Long(3000));
-        rma.setBaseRetransmissionInterval(bri);  
+        config = new RMConfiguration();
+        config.setBaseRetransmissionInterval(new Long(3000));
+        EasyMock.expect(manager.getConfiguration()).andReturn(config).anyTimes();
 
-        EasyMock.expect(manager.getRMAssertion()).andReturn(rma).anyTimes();
         EasyMock.expect(manager.getDestinationPolicy()).andReturn(dp).anyTimes();
         EasyMock.expect(manager.getStore()).andReturn(null).anyTimes();
         

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=1489358&r1=1489357&r2=1489358&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 Jun  4 09:34:53 2013
@@ -58,12 +58,12 @@ public class RMManagerConfigurationTest 
         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());
+        RMConfiguration cfg = manager.getConfiguration();
+        assertNotNull(cfg.getDeliveryAssurance().getAtLeastOnce());
+        assertTrue(cfg.getDeliveryAssurance().isSetAtLeastOnce());
+        assertNotNull(cfg.getDeliveryAssurance().getAtMostOnce());
+        assertTrue(cfg.getDeliveryAssurance().isSetAtMostOnce());
+        assertTrue(cfg.isExactlyOnce());
     }
     
     @Test
@@ -79,14 +79,13 @@ public class RMManagerConfigurationTest 
         assertTrue(manager.getSourcePolicy().getSequenceTerminationPolicy().isTerminateOnShutdown());
         assertEquals(0L, manager.getDestinationPolicy().getAcksPolicy().getIntraMessageThreshold());
         assertEquals(2000L, manager.getDestinationPolicy().getAcksPolicy().getImmediaAcksTimeout());
-        assertEquals(10000L, manager.getRMAssertion().getBaseRetransmissionInterval()
-                     .getMilliseconds().longValue());
-        assertEquals(10000L, manager.getRMAssertion().getAcknowledgementInterval()
-                     .getMilliseconds().longValue());        
-        assertEquals("http://www.w3.org/2005/08/addressing", manager.getRMAddressingNamespace().getUri());
+        assertEquals(10000L, manager.getConfiguration().getBaseRetransmissionInterval().longValue());
+        assertEquals(10000L, manager.getConfiguration().getAcknowledgementInterval().longValue());        
+        assertEquals("http://www.w3.org/2005/08/addressing",
+            manager.getConfiguration().getRM10AddressingNamespace().getUri());
         TestStore store = (TestStore)manager.getStore();
         assertEquals("here", store.getLocation());     
-        assertNotNull(manager.getDeliveryAssurance().getInOrder());
+        assertNotNull(manager.getConfiguration().getDeliveryAssurance().getInOrder());
     }
 
     static class TestStore implements RMStore {

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java Tue Jun  4 09:34:53 2013
@@ -59,10 +59,10 @@ import org.apache.cxf.ws.rm.persistence.
 import org.apache.cxf.ws.rm.persistence.RMStore;
 import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
 import org.apache.cxf.ws.rm.v200702.Identifier;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -103,23 +103,22 @@ public class RMManagerTest extends Asser
     @Test
     public void testInitialisation() {
         manager = new RMManager();
-        assertNull("RMAssertion is set.", manager.getRMAssertion());
+        assertNull("RMConfiguration is set.", manager.getConfiguration());
         assertNull("sourcePolicy is set.", manager.getSourcePolicy());
         assertNull("destinationPolicy is set.", manager.getDestinationPolicy());
-        assertNull("deliveryAssirance is set.", manager.getDeliveryAssurance());
         
         manager.initialise();
         
-        assertNotNull("RMAssertion is not set.", manager.getRMAssertion());
+        RMConfiguration cfg = manager.getConfiguration();
+        assertNotNull("RMAssertion is not set.", cfg);
         assertNotNull("sourcePolicy is not set.", manager.getSourcePolicy());
         assertNotNull("destinationPolicy is not set.", manager.getDestinationPolicy());
-        assertNotNull("deliveryAssirance is not set.", manager.getDeliveryAssurance());
+        assertNotNull("deliveryAssirance is not set.", cfg.getDeliveryAssurance());
         
-        RMAssertion rma = manager.getRMAssertion();
-        assertTrue(rma.isSetExponentialBackoff());
-        assertEquals(3000L, rma.getBaseRetransmissionInterval().getMilliseconds().longValue());
-        assertTrue(!rma.isSetAcknowledgementInterval());
-        assertTrue(!rma.isSetInactivityTimeout());   
+        assertTrue(cfg.isExponentialBackoff());
+        assertEquals(3000L, cfg.getBaseRetransmissionInterval().longValue());
+        assertNull(cfg.getAcknowledgementInterval());
+        assertNull(cfg.getInactivityTimeout());   
         
         SourcePolicyType sp = manager.getSourcePolicy();
         assertEquals(0L, sp.getSequenceExpiration().getTimeInMillis(new Date()));

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java?rev=1489358&r1=1489357&r2=1489358&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java Tue Jun  4 09:34:53 2013
@@ -27,6 +27,7 @@ import java.util.concurrent.Executor;
 
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
+import org.apache.cxf.ws.rm.RMConfiguration;
 import org.apache.cxf.ws.rm.RMManager;
 import org.apache.cxf.ws.rm.RMMessageConstants;
 import org.apache.cxf.ws.rm.RMProperties;
@@ -36,7 +37,6 @@ import org.apache.cxf.ws.rm.manager.Sour
 import org.apache.cxf.ws.rm.persistence.RMStore;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
-import org.apache.cxf.ws.rmp.v200502.RMAssertion;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
 
@@ -62,7 +62,6 @@ public class RetransmissionQueueImplTest
     private List<SequenceType> sequences = new ArrayList<SequenceType>();
     private List<Identifier> identifiers = new ArrayList<Identifier>();
     private List<Object> mocks = new ArrayList<Object>();
-    private RMAssertion rma;
     
     @Before
     public void setUp() {
@@ -72,7 +71,6 @@ public class RetransmissionQueueImplTest
         resender = new TestResender();
         queue.replaceResender(resender);
         executor = createMock(Executor.class);
-        rma = createMock(RMAssertion.class);
         assertNotNull(executor);
     }
     
@@ -368,13 +366,10 @@ public class RetransmissionQueueImplTest
     
     private void setupMessagePolicies(Message message) {
         EasyMock.expect(message.get(AssertionInfoMap.class)).andReturn(null);
-        EasyMock.expect(manager.getRMAssertion()).andReturn(rma);
-        RMAssertion.BaseRetransmissionInterval bri = 
-            createMock(RMAssertion.BaseRetransmissionInterval.class);
-        EasyMock.expect(rma.getBaseRetransmissionInterval()).andReturn(bri);
-        EasyMock.expect(bri.getMilliseconds()).andReturn(new Long(5000));
-        RMAssertion.ExponentialBackoff eb = createMock(RMAssertion.ExponentialBackoff.class);
-        EasyMock.expect(rma.getExponentialBackoff()).andReturn(eb);        
+        RMConfiguration cfg = new RMConfiguration();
+        EasyMock.expect(manager.getConfiguration()).andReturn(cfg);
+        cfg.setBaseRetransmissionInterval(new Long(5000));
+        cfg.setExponentialBackoff(true);
     }
     
     private void setupRetryPolicy(Message message) {



Mime
View raw message