cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsosno...@apache.org
Subject svn commit: r1137112 [2/7] - in /cxf/trunk: rt/ws/rm/ rt/ws/rm/src/main/build-resources/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/feature/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/ rt/ws/rm...
Date Sat, 18 Jun 2011 01:51:04 GMT
Added: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RM11Constants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RM11Constants.java?rev=1137112&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RM11Constants.java (added)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RM11Constants.java Sat Jun 18 01:51:01 2011
@@ -0,0 +1,260 @@
+/**
+ * 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 java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Holder for names for WS-ReliableMessaging 1.1.
+ */
+public final class RM11Constants extends RMConstants {
+    
+    public static final RM11Constants INSTANCE = new RM11Constants();
+   
+    // namespaces
+    public static final String NAMESPACE_URI = "http://docs.oasis-open.org/ws-rx/wsrm/200702";
+    
+    public static final String WSRMP_NAMESPACE_URI = "http://docs.oasis-open.org/ws-rx/wsrmp/200702";
+    
+    public static final String WSDL_NAMESPACE_URI = NAMESPACE_URI + "/wsdl";
+    
+    // element and header names
+    
+    public static final QName SEQUENCE_QNAME = new QName(NAMESPACE_URI, SEQUENCE_NAME);
+    
+    public static final QName SEQUENCE_FAULT_QNAME = new QName(NAMESPACE_URI, SEQUENCE_FAULT_NAME);
+    
+    public static final QName SEQUENCE_ACK_QNAME = new QName(NAMESPACE_URI, SEQUENCE_ACK_NAME);
+    
+    public static final QName ACK_REQUESTED_QNAME = new QName(NAMESPACE_URI, ACK_REQUESTED_NAME);
+    
+    public static final QName WSRMP_RMASSERTION_QNAME = new QName(WSRMP_NAMESPACE_URI, RMASSERTION_NAME);
+    
+    // protocol operation names
+    
+    public static final QName PORT_NAME =
+        new QName(WSDL_NAMESPACE_URI, "SequenceAbstractSoapPort"); 
+    
+    public static final QName CREATE_SEQUENCE_QNAME = new QName(NAMESPACE_URI, "CreateSequence");
+    
+    public static final QName CREATE_SEQUENCE_RESPONSE_QNAME =
+        new QName(NAMESPACE_URI, "CreateSequenceResponse");
+    
+    public static final QName TERMINATE_SEQUENCE_QNAME =
+        new QName(NAMESPACE_URI, "TerminateSequence");
+    
+    public static final QName SEQUENCE_ACKNOWLEDGEMENT_QNAME =
+        new QName(NAMESPACE_URI, "SequenceAcknowledgement");
+    
+    public static final QName CLOSE_SEQUENCE_QNAME = new QName(NAMESPACE_URI, "CloseSequence");
+    
+    public static final QName ACK_REQ_QNAME = new QName(NAMESPACE_URI, "AckRequested");
+    
+    public static final QName CREATE_SEQUENCE_ONEWAY_QNAME =
+        new QName(NAMESPACE_URI, "CreateSequenceOneway");
+    
+    public static final QName CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME =
+        new QName(NAMESPACE_URI, "CreateSequenceResponseOneway");
+    
+    public static final QName RMASSERTION_QNAME =  new QName(WSRMP_NAMESPACE_URI, RMASSERTION_NAME);
+
+    // actions
+    
+    public static final String CREATE_SEQUENCE_ACTION =
+        NAMESPACE_URI + "/CreateSequence";
+    
+    public static final String CREATE_SEQUENCE_RESPONSE_ACTION =
+        NAMESPACE_URI + "/CreateSequenceResponse";
+    
+    public static final String TERMINATE_SEQUENCE_ACTION =
+        NAMESPACE_URI + "/TerminateSequence";
+    
+    public static final String TERMINATE_SEQUENCE_RESPONSE_ACTION =
+        NAMESPACE_URI + "/TerminateSequenceResponse";
+    
+    public static final String CLOSE_SEQUENCE_ACTION =
+        NAMESPACE_URI + "/CloseSequence";    
+    
+    public static final String CLOSE_SEQUENCE_RESPONSE_ACTION =
+        NAMESPACE_URI + "/CloseSequenceResponse";    
+    
+    public static final String ACK_REQUESTED_ACTION =
+        NAMESPACE_URI + "/AckRequested";
+    
+    public static final String SEQUENCE_ACKNOWLEDGMENT_ACTION =
+        NAMESPACE_URI + "/SequenceAcknowledgement";
+    
+    public static final String SEQUENCE_INFO_ACTION =
+        NAMESPACE_URI + "/SequenceInfo";
+    
+    public static final Set<String> ACTIONS;
+    static {
+        Set<String> actions = new HashSet<String>();
+        actions.add(CREATE_SEQUENCE_ACTION);
+        actions.add(CREATE_SEQUENCE_RESPONSE_ACTION);
+        actions.add(TERMINATE_SEQUENCE_ACTION);
+        actions.add(TERMINATE_SEQUENCE_RESPONSE_ACTION);
+        actions.add(CLOSE_SEQUENCE_ACTION);
+        actions.add(CLOSE_SEQUENCE_RESPONSE_ACTION);
+        actions.add(ACK_REQUESTED_ACTION);
+        actions.add(SEQUENCE_ACKNOWLEDGMENT_ACTION);
+        actions.add(SEQUENCE_INFO_ACTION);
+        ACTIONS = actions;
+    }
+
+    // fault codes
+    
+    public static final QName UNKNOWN_SEQUENCE_FAULT_QNAME =
+        new QName(NAMESPACE_URI, UNKNOWN_SEQUENCE_FAULT_CODE);
+    
+    public static final QName SEQUENCE_TERMINATED_FAULT_QNAME =
+        new QName(NAMESPACE_URI, SEQUENCE_TERMINATED_FAULT_CODE);
+    
+    public static final QName INVALID_ACKNOWLEDGMENT_FAULT_QNAME =
+        new QName(NAMESPACE_URI, INVALID_ACKNOWLEDGMENT_FAULT_CODE);
+    
+    public static final QName MESSAGE_NUMBER_ROLLOVER_FAULT_QNAME =
+        new QName(NAMESPACE_URI, MESSAGE_NUMBER_ROLLOVER_FAULT_CODE);
+    
+    public static final QName CREATE_SEQUENCE_REFUSED_FAULT_QNAME =
+        new QName(NAMESPACE_URI, CREATE_SEQUENCE_REFUSED_FAULT_CODE);
+    
+    public static final QName SEQUENCE_CLOSED_FAULT_QNAME =
+        new QName(NAMESPACE_URI, SEQUENCE_CLOSED_FAULT_CODE);
+    
+    public static final QName WSRM_REQUIRED_FAULT_QNAME =
+        new QName(NAMESPACE_URI, WSRM_REQUIRED_FAULT_CODE);
+    
+    // headers
+    
+    public static final Set<QName> HEADERS;
+    static {
+        Set<QName> headers = new HashSet<QName>();
+        headers.add(new QName(NAMESPACE_URI, SEQUENCE_NAME));
+        headers.add(new QName(NAMESPACE_URI, SEQUENCE_ACK_NAME));
+        headers.add(new QName(NAMESPACE_URI, ACK_REQUESTED_NAME));
+        HEADERS = Collections.unmodifiableSet(headers);
+    }
+    
+    private RM11Constants() {
+    }
+    
+    // actions access methods
+    
+    public String getCreateSequenceAction() {
+        return CREATE_SEQUENCE_ACTION;
+    }
+
+    public String getCreateSequenceResponseAction() {
+        return CREATE_SEQUENCE_RESPONSE_ACTION;
+    }
+    
+    public String getTerminateSequenceAction() {
+        return TERMINATE_SEQUENCE_ACTION;
+    }
+    
+    public String getCloseSequenceAction() {
+        return CLOSE_SEQUENCE_ACTION;
+    }
+    
+    public String getAckRequestedAction() {
+        return ACK_REQUESTED_ACTION;
+    }
+    
+    public String getSequenceAckAction() {
+        return SEQUENCE_ACKNOWLEDGMENT_ACTION;
+    }
+    
+    public String getSequenceInfoAction() {
+        return SEQUENCE_INFO_ACTION;
+    }
+    
+    // service model constants access methods
+    
+    public QName getPortName() {
+        return PORT_NAME;
+    }
+    
+    public QName getCreateSequenceOperationName() {
+        return CREATE_SEQUENCE_QNAME;
+    }
+    
+    public QName getCreateSequenceResponseOperationName() {
+        return CREATE_SEQUENCE_RESPONSE_QNAME;
+    }
+    
+    public QName getCreateSequenceOnewayOperationName() {
+        return CREATE_SEQUENCE_ONEWAY_QNAME;
+    }
+    
+    public QName getCreateSequenceResponseOnewayOperationName() {
+        return CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME;
+    }
+    
+    public QName getTerminateSequenceOperationName() {
+        return TERMINATE_SEQUENCE_QNAME;
+    }
+    
+    public QName getCloseSequenceOperationName() {
+        return CLOSE_SEQUENCE_QNAME;
+    }
+    
+    public QName getSequenceAckOperationName() {
+        return SEQUENCE_ACKNOWLEDGEMENT_QNAME;
+    }
+    
+    public QName getAckRequestedOperationName() {
+        return ACK_REQ_QNAME;
+    }
+    
+    // fault codes access methods
+    
+    public QName getUnknownSequenceFaultCode() {
+        return UNKNOWN_SEQUENCE_FAULT_QNAME;
+    }
+        
+    public QName getSequenceTerminatedFaultCode() {
+        return SEQUENCE_TERMINATED_FAULT_QNAME;
+    }
+        
+    public QName getInvalidAcknowledgmentFaultCode() {
+        return INVALID_ACKNOWLEDGMENT_FAULT_QNAME;
+    }
+  
+    public QName getMessageNumberRolloverFaultCode() {
+        return MESSAGE_NUMBER_ROLLOVER_FAULT_QNAME;
+    }
+    
+    public QName getCreateSequenceRefusedFaultCode() {
+        return CREATE_SEQUENCE_REFUSED_FAULT_QNAME;
+    }
+    
+    public QName getSequenceClosedFaultCode() {
+        return SEQUENCE_CLOSED_FAULT_QNAME;
+    }
+    
+    public QName getWSRMRequiredFaultCode() {
+        return WSRM_REQUIRED_FAULT_QNAME;
+    }
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java Sat Jun 18 01:51:01 2011
@@ -19,333 +19,113 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
 import javax.xml.namespace.QName;
 
-
 /**
  * Holder for WS-RM names (of headers, namespaces etc.).
  */
-public final class RMConstants {
-   
+public abstract class RMConstants {
+    
     // namespaces
-    private static final String WSRM_NAMESPACE_NAME = 
-        "http://schemas.xmlsoap.org/ws/2005/02/rm";
     
-    private static final String WSRMP_NAMESPACE_NAME = 
-        "http://schemas.xmlsoap.org/ws/2005/02/rm/policy";
+    public static final String NAMESPACE_PREFIX = "wsrm";
     
-    private static final String WSA_NAMESPACE_NAME = 
-        "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+    // WSDL
     
-    private static final String WSRM_NAMESPACE_PREFIX = "wsrm";
+    public static final String SERVICE_NAME = "SequenceAbstractService";
     
-    private static final String WSRM_WSDL_NAMESPACE_NAME = 
-        WSRM_NAMESPACE_NAME + "/wsdl";
+    public static final String INTERFACE_NAME = "SequenceAbstractPortType";
     
+    public static final String BINDING_NAME = "SequenceAbstractSoapBinding";
   
     // element and header names
     
-    private static final String WSRM_SEQUENCE_NAME =
-        "Sequence";    
-    
-    private static final QName WSRM_SEQUENCE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, WSRM_SEQUENCE_NAME);
-    
-    private static final String WSRM_SEQUENCE_FAULT_NAME =
-        "SequenceFault";
-    
-    private static final QName WSRM_SEQUENCE_FAULT_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, WSRM_SEQUENCE_FAULT_NAME);
-    
-    private static final String WSRM_SEQUENCE_ACK_NAME =
-        "SequenceAcknowledgement";
-    
-    private static final QName WSRM_SEQUENCE_ACK_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, WSRM_SEQUENCE_ACK_NAME);
-    
-    private static final String WSRM_ACK_REQUESTED_NAME =
-        "AckRequested";
-    
-    private static final QName WSRM_ACK_REQUESTED_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, WSRM_ACK_REQUESTED_NAME);
-    
-    private static final String WSA_ANONYMOUS_ADDRESS = 
-        WSA_NAMESPACE_NAME + "/role/anonymous";
+    public static final String SEQUENCE_NAME = "Sequence";    
     
-    private static final String WSA_NONE_ADDRESS =
-        WSA_NAMESPACE_NAME + "/role/none";
+    public static final String SEQUENCE_FAULT_NAME = "SequenceFault";
     
-    private static final String RMASSERTION_NAME = "RMAssertion";
+    public static final String SEQUENCE_ACK_NAME = "SequenceAcknowledgement";
     
-    private static final QName RMASSERTION_QNAME = 
-        new QName(WSRMP_NAMESPACE_NAME, RMASSERTION_NAME);
-      
-    private static final Set<QName> HEADERS;
+    public static final String ACK_REQUESTED_NAME = "AckRequested";
     
-    // protocol operation names
-    
-    private static final QName WSRM_PORT_NAME =
-        new QName(WSRM_WSDL_NAMESPACE_NAME, "SequenceAbstractSoapPort"); 
-    
-    private static final QName WSRM_CREATE_SEQUENCE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequence");
-    
-    private static final QName WSRM_CREATE_SEQUENCE_RESPONSE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequenceResponse");
-    
-    private static final QName WSRM_CREATE_SEQUENCE_ONEWAY_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequenceOneway");
-    
-    private static final QName WSRM_CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequenceResponseOneway");
-    
-    private static final QName WSRM_TERMINATE_SEQUENCE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "TerminateSequence");
-    
-    private static final QName WSRM_SEQUENCE_ACKNOWLEDGEMENT_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "SequenceAcknowledgement");
-    
-    private static final QName WSRM_LAST_MESSAGE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "LastMessage");
-    
-    private static final QName WSRM_ACK_REQ_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "AckRequested");
- 
-
-    // actions
-    
-    private static final String WSRM_CREATE_SEQUENCE_ACTION =
-        WSRM_NAMESPACE_NAME + "/CreateSequence";
-    
-    private static final String WSRM_CREATE_SEQUENCE_RESPONSE_ACTION =
-        WSRM_NAMESPACE_NAME + "/CreateSequenceResponse";
-    
-    private static final String WSRM_TERMINATE_SEQUENCE_ACTION =
-        WSRM_NAMESPACE_NAME + "/TerminateSequence";
-    
-    private static final String WSRM_SEQUENCE_ACK_ACTION =
-        WSRM_NAMESPACE_NAME + "/SequenceAcknowledgement";
-    
-    private static final String WSRM_LAST_MESSAGE_ACTION =
-        WSRM_NAMESPACE_NAME + "/LastMessage";
-    
-    private static final String WSRM_ACK_REQUESTED_ACTION =
-        WSRM_NAMESPACE_NAME + "/AckRequested";
-    
-    private static final String WSRM_SEQUENCE_ACKNOWLEDGMENT_ACTION =
-        WSRM_NAMESPACE_NAME + "/SequenceAcknowledgement";
-    
-    private static final String WSRM_SEQUENCE_INFO_ACTION =
-        WSRM_NAMESPACE_NAME + "/SequenceInfo";
+    public static final String RMASSERTION_NAME = "RMAssertion";
     
     // fault codes
     
-    private static final String WSRM_UNKNOWN_SEQUENCE_FAULT_CODE =
-        "UnknownSequence";
-    
-    private static final String WSRM_SEQUENCE_TERMINATED_FAULT_CODE =
-        "SequenceTerminated";
-    
-    private static final String WSRM_INVALID_ACKNOWLEDGMENT_FAULT_CODE =
-        "InvalidAcknowledgement";
+    public static final String UNKNOWN_SEQUENCE_FAULT_CODE = "UnknownSequence";
     
-    private static final String WSRM_MESSAGE_NUMBER_ROLLOVER_FAULT_CODE =
-        "MessageNumberRollover";
-    
-    private static final String WSRM_CREATE_SEQUENCE_REFUSED_FAULT_CODE =
-        "CreateSequenceRefused";
-    
-    private static final String WSRM_LAST_MESSAGE_NUMBER_EXCEEDED_FAULT_CODE =
-        "LastMessageNumberExceeded";
-    
-    static {
-        Set<QName> headers = new HashSet<QName>();
-        headers.add(WSRM_SEQUENCE_QNAME);
-        headers.add(WSRM_SEQUENCE_ACK_QNAME);
-        headers.add(WSRM_ACK_REQUESTED_QNAME);
-        HEADERS = Collections.unmodifiableSet(headers);
-    }
-    
-    private RMConstants() {
-    }
-    
-    public static Set<QName> getHeaders() {
-        return HEADERS;
-    }
+    public static final String SEQUENCE_TERMINATED_FAULT_CODE = "SequenceTerminated";
     
-    // namespaces
-    
-    public static String getNamespace() {
-        return WSRM_NAMESPACE_NAME; 
-    }
-        
-    public static String getPolicyNamespace() {
-        return WSRMP_NAMESPACE_NAME;
-    }
-    
-    public static String getAddressingNamespace() {
-        return WSA_NAMESPACE_NAME;        
-    }
-    
-    public static String getNamespacePrefix() {
-        return WSRM_NAMESPACE_PREFIX;
-    }
-    
-    public static  String getWsdlNamespace() {
-        return WSRM_WSDL_NAMESPACE_NAME;
-    }  
-    
-    // schema type constants
-  
-    public static String getSequenceName() {
-        return WSRM_SEQUENCE_NAME;
-    }
+    public static final String INVALID_ACKNOWLEDGMENT_FAULT_CODE = "InvalidAcknowledgement";
     
-    public static QName getSequenceQName() {
-        return WSRM_SEQUENCE_QNAME;
-    }
+    public static final String MESSAGE_NUMBER_ROLLOVER_FAULT_CODE = "MessageNumberRollover";
     
-    public static String getSequenceFaultName() {
-        return WSRM_SEQUENCE_FAULT_NAME;
-    }
+    public static final String CREATE_SEQUENCE_REFUSED_FAULT_CODE = "CreateSequenceRefused";
     
-    public static QName getSequenceFaultQName() {
-        return WSRM_SEQUENCE_FAULT_QNAME;
-    }
+    // WS-RM 1.1 only
+    public static final String SEQUENCE_CLOSED_FAULT_CODE = "SequenceClosed";
     
-    public static String getSequenceAckName() {
-        return WSRM_SEQUENCE_ACK_NAME;
-    }
+    public static final String WSRM_REQUIRED_FAULT_CODE = "WSRMRequired";
     
-    public static QName getSequenceAckQName() {
-        return WSRM_SEQUENCE_ACK_QNAME;
-    }
+    // actions access methods
     
-    public static String getAckRequestedName() {
-        return WSRM_ACK_REQUESTED_NAME;
-    }
+    public abstract String getCreateSequenceAction();
+
+    public abstract String getCreateSequenceResponseAction();
     
-    public static QName getAckRequestedQName() {
-        return WSRM_ACK_REQUESTED_QNAME;
-    }
+    public abstract String getCloseSequenceAction();
     
-    public static String getAnonymousAddress() {
-        return WSA_ANONYMOUS_ADDRESS; 
-    }
+    public abstract String getTerminateSequenceAction();
     
-    public static String getNoneAddress() {
-        return WSA_NONE_ADDRESS;
-    }
+    public abstract String getAckRequestedAction();
     
-    // service model constants
+    public abstract String getSequenceAckAction();
     
-    public static QName getPortName() {
-        return WSRM_PORT_NAME;
-    }
+    public abstract String getSequenceInfoAction();
     
-    public static QName getCreateSequenceOperationName() {
-        return WSRM_CREATE_SEQUENCE_QNAME;
-    }
+    // service model constants access methods
     
-    public static QName getCreateSequenceResponseOperationName() {
-        return WSRM_CREATE_SEQUENCE_RESPONSE_QNAME;
-    }
+    public abstract QName getPortName();
     
-    public static QName getCreateSequenceOnewayOperationName() {
-        return WSRM_CREATE_SEQUENCE_ONEWAY_QNAME;
-    }
+    public abstract QName getCreateSequenceOperationName();
     
-    public static QName getCreateSequenceResponseOnewayOperationName() {
-        return WSRM_CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME;
-    }
+    public abstract QName getCreateSequenceResponseOperationName();
     
-    public static QName getTerminateSequenceOperationName() {
-        return WSRM_TERMINATE_SEQUENCE_QNAME;
-    }
+    public abstract QName getCreateSequenceOnewayOperationName();
     
-    public static QName getSequenceAckOperationName() {
-        return WSRM_SEQUENCE_ACKNOWLEDGEMENT_QNAME;
-    }
+    public abstract QName getCreateSequenceResponseOnewayOperationName();
     
-    public static QName getLastMessageOperationName() {
-        return WSRM_LAST_MESSAGE_QNAME;
-    }
+    public abstract QName getCloseSequenceOperationName();
     
-    public static QName getAckRequestedOperationName() {
-        return WSRM_ACK_REQ_QNAME;
-    }
+    public abstract QName getTerminateSequenceOperationName();
     
-    // actions
+    public abstract QName getSequenceAckOperationName();
     
-    public static String getCreateSequenceAction() {
-        return WSRM_CREATE_SEQUENCE_ACTION;
-    }
-
-    public static String getCreateSequenceResponseAction() {
-        return WSRM_CREATE_SEQUENCE_RESPONSE_ACTION;
-    }
-    
-    public static String getTerminateSequenceAction() {
-        return WSRM_TERMINATE_SEQUENCE_ACTION;
-    }
-    
-    public static String getSequenceAckAction() {
-        return WSRM_SEQUENCE_ACK_ACTION;
-    }
-    
-    public static String getLastMessageAction() {
-        return WSRM_LAST_MESSAGE_ACTION;
-    }
-    
-    public static String getAckRequestedAction() {
-        return WSRM_ACK_REQUESTED_ACTION;
-    }
-    
-    public static String getSequenceAcknowledgmentAction() {
-        return WSRM_SEQUENCE_ACKNOWLEDGMENT_ACTION;
-    }
-    
-    public static String getSequenceInfoAction() {
-        return WSRM_SEQUENCE_INFO_ACTION;
-    }
+    public abstract QName getAckRequestedOperationName();
     
-    // fault codes
+    // fault codes access methods
     
-    public static QName getUnknownSequenceFaultCode() {
-        return new QName(WSRM_NAMESPACE_NAME, WSRM_UNKNOWN_SEQUENCE_FAULT_CODE);
-    }
+    public abstract QName getUnknownSequenceFaultCode();
         
-    public static QName getSequenceTerminatedFaultCode() {
-        return new QName(WSRM_NAMESPACE_NAME, WSRM_SEQUENCE_TERMINATED_FAULT_CODE);
-    }
+    public abstract QName getSequenceTerminatedFaultCode();
         
-    public static QName getInvalidAcknowledgmentFaultCode() {
-        return new QName(RMConstants.WSRM_NAMESPACE_NAME, WSRM_INVALID_ACKNOWLEDGMENT_FAULT_CODE);
-    }
+    public abstract QName getInvalidAcknowledgmentFaultCode();
   
-    public static QName getMessageNumberRolloverFaultCode() {
-        return new QName(WSRM_NAMESPACE_NAME, WSRM_MESSAGE_NUMBER_ROLLOVER_FAULT_CODE);
-    }
-    
-    public static QName getCreateSequenceRefusedFaultCode() {
-        return new QName(WSRM_NAMESPACE_NAME, WSRM_CREATE_SEQUENCE_REFUSED_FAULT_CODE);
-    }
-    
-    public static QName getLastMessageNumberExceededFaultCode() {
-        return new QName(WSRM_NAMESPACE_NAME, WSRM_LAST_MESSAGE_NUMBER_EXCEEDED_FAULT_CODE);
-    }
-    
-    // policies
-    
-    public static String getRMAssertionName() {
-        return RMASSERTION_NAME;
-    }
-    
-    public static QName getRMAssertionQName() {
-        return RMASSERTION_QNAME;
-    }
-}
+    public abstract QName getMessageNumberRolloverFaultCode();
+    
+    public abstract QName getCreateSequenceRefusedFaultCode();
+    
+    /**
+     * Get SequenceClosed fault code.
+     * 
+     * @return code, or <code>null</code> if not supported
+     */
+    public abstract QName getSequenceClosedFaultCode();
+    
+    /**
+     * Get WSRMRequired fault code.
+     * 
+     * @return code, or <code>null</code> if not supported
+     */
+    public abstract QName getWSRMRequiredFaultCode();
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java Sat Jun 18 01:51:01 2011
@@ -23,7 +23,6 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
-import org.apache.cxf.ws.addressing.VersionTransformer;
 
 /**
  * Holder for utility methods relating to contexts.
@@ -61,12 +60,7 @@ public final class RMContextUtils {
      * @return true iff the action is not one of the RM protocol actions.
      */
     public static boolean isRMProtocolMessage(String action) {
-        return RMConstants.getCreateSequenceAction().equals(action)
-            || RMConstants.getCreateSequenceResponseAction().equals(action)
-            || RMConstants.getTerminateSequenceAction().equals(action)
-            || RMConstants.getLastMessageAction().equals(action)
-            || RMConstants.getSequenceAcknowledgmentAction().equals(action)
-            || RMConstants.getSequenceInfoAction().equals(action);
+        return RM10Constants.ACTIONS.contains(action) || RM11Constants.ACTIONS.contains(action);
     }
 
     /**
@@ -140,15 +134,6 @@ public final class RMContextUtils {
         org.apache.cxf.ws.addressing.ContextUtils.storeMAPs(maps, message, isOutbound, isRequestor);
     }
 
-    /**
-     * Ensures the appropriate version of WS-Addressing is used.
-     * 
-     * @param maps the addressing properties
-     */
-    public static void ensureExposedVersion(AddressingProperties maps) {
-        ((AddressingPropertiesImpl)maps).exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
-    }
-
     public static String getRMPropertiesKey(boolean outbound) {
         return outbound
             ? RMMessageConstants.RM_PROPERTIES_OUTBOUND : RMMessageConstants.RM_PROPERTIES_INBOUND;

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Sat Jun 18 01:51:01 2011
@@ -25,13 +25,9 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.wsdl.extensions.ExtensibilityElement;
-import javax.xml.XMLConstants;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
 
 import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
@@ -54,6 +50,7 @@ import org.apache.cxf.service.model.Mess
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.JAXWSAConstants;
 import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.Names;
@@ -69,34 +66,50 @@ import org.apache.neethi.Policy;
 public class RMEndpoint {
 
     private static final Logger LOG = LogUtils.getL7dLogger(RMEndpoint.class);
-
-    private static final QName SERVICE_NAME = new QName(RMConstants.getWsdlNamespace(),
-                                                        "SequenceAbstractService");
-    private static final QName INTERFACE_NAME = new QName(RMConstants.getWsdlNamespace(),
-                                                          "SequenceAbstractPortType");
-    private static final QName BINDING_NAME = new QName(RMConstants.getWsdlNamespace(),
-                                                        "SequenceAbstractSoapBinding");
-
-    private static final QName CREATE_PART_NAME = new QName(RMConstants.getWsdlNamespace(), "create");
-    private static final QName CREATE_RESPONSE_PART_NAME = new QName(RMConstants.getWsdlNamespace(),
-                                                                     "createResponse");
-    private static final QName TERMINATE_PART_NAME = new QName(RMConstants.getWsdlNamespace(), "terminate");
     
-    private static Schema rmSchema;
+    private static final String SERVICE_NAME = "SequenceAbstractService";
+    private static final String INTERFACE_NAME = "SequenceAbstractPortType";
+    private static final String BINDING_NAME = "SequenceAbstractSoapBinding";
+
+    private static final String CREATE_PART_NAME = "create";
+    private static final String CREATE_RESPONSE_PART_NAME = "createResponse";
+    private static final String TERMINATE_PART_NAME = "terminate";
 
     private RMManager manager;
     private Endpoint applicationEndpoint;
     private Conduit conduit;
-    private org.apache.cxf.ws.addressing.EndpointReferenceType replyTo;
+    private EncoderDecoder encoderDecoder;
+    private EndpointReferenceType replyTo;
     private Source source;
     private Destination destination;
     private WrappedService service;
     private Endpoint endpoint;
     private Proxy proxy;
     private Servant servant;
+    private QName serviceQName;
+    private QName bindingQName;
+    private QName interfaceQName;
     private long lastApplicationMessage;
     private long lastControlMessage;
 
+    /**
+     * Constructor when WS-ReliableMessaging version to be used is already known.
+     * 
+     * @param m
+     * @param ae
+     * @param codec
+     */
+    public RMEndpoint(RMManager m, Endpoint ae, EncoderDecoder codec) {
+        this(m, ae);
+        encoderDecoder = codec;
+    }
+
+    /**
+     * Constructor when WS-ReliableMessaging version to be used is not yet known.
+     * 
+     * @param m
+     * @param ae
+     */
     public RMEndpoint(RMManager m, Endpoint ae) {
         manager = m;
         applicationEndpoint = ae;
@@ -128,6 +141,26 @@ public class RMEndpoint {
     }
 
     /**
+     * Get the encoder/decoder used by this endpoint.
+     * 
+     * @return URI
+     */
+    public EncoderDecoder getEncoderDecoder() {
+        return encoderDecoder;
+    }
+
+    /**
+     * Set the encoder/decoder used by this endpoint. This should only be used if the encoder/decoder was not
+     * set by the constructor, and only used once in that case - once set the encoder/decoder should never be
+     * changed.
+     * 
+     * @param codec
+     */
+    public void setEncoderDecoder(EncoderDecoder codec) {
+        encoderDecoder = codec;
+    }
+
+    /**
      * @return Returns the RM protocol service.
      */
     public Service getService() {
@@ -138,7 +171,7 @@ public class RMEndpoint {
      * @return Returns the RM protocol binding info.
      */
     public BindingInfo getBindingInfo() {
-        return service.getServiceInfo().getBinding(BINDING_NAME);
+        return service.getServiceInfo().getBinding(bindingQName);
     }
 
     /**
@@ -225,12 +258,12 @@ public class RMEndpoint {
      * 
      * @return the replyTo address
      */
-    org.apache.cxf.ws.addressing.EndpointReferenceType getReplyTo() {
+    EndpointReferenceType getReplyTo() {
         return replyTo;
     }
 
     void initialise(Conduit c, 
-                    org.apache.cxf.ws.addressing.EndpointReferenceType r,
+                    EndpointReferenceType r,
                     org.apache.cxf.transport.Destination d) {
         conduit = c;
         replyTo = r;
@@ -241,20 +274,18 @@ public class RMEndpoint {
 
     void createService() {
         ServiceInfo si = new ServiceInfo();
-        si.setProperty(Schema.class.getName(), getSchema());
-        
-        si.setName(SERVICE_NAME);
+        serviceQName = new QName(encoderDecoder.getWSRMNamespace(), SERVICE_NAME);
+        si.setName(serviceQName);
         
         buildInterfaceInfo(si);
 
-        service = new WrappedService(applicationEndpoint.getService(), SERVICE_NAME, si);
+        service = new WrappedService(applicationEndpoint.getService(), serviceQName, si);
 
         DataBinding dataBinding = null;
+        Class create = encoderDecoder.getCreateSequenceType();
         try {
             JAXBContext ctx =
-                JAXBContext.newInstance(
-                    PackageUtils.getPackageName(CreateSequenceType.class),
-                    CreateSequenceType.class.getClassLoader());
+                JAXBContext.newInstance(PackageUtils.getPackageName(create), create.getClassLoader());
             dataBinding = new JAXBDataBinding(ctx);
         } catch (JAXBException e) {
             throw new ServiceConstructionException(e);
@@ -263,27 +294,6 @@ public class RMEndpoint {
         service.setInvoker(servant);
     }
 
-    private static synchronized Schema getSchema() {
-        if (rmSchema == null) {
-            try {
-                SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-                javax.xml.transform.Source ad = new StreamSource(RMEndpoint.class
-                                             .getResource("/schemas/wsdl/addressing.xsd")
-                                             .openStream(),
-                                             "http://schemas.xmlsoap.org/ws/2004/08/addressing");
-                javax.xml.transform.Source rm = new StreamSource(RMEndpoint.class
-                                                                 .getResource("/schemas/wsdl/wsrm.xsd")
-                                                                 .openStream());
-                
-                javax.xml.transform.Source schemas[] = new javax.xml.transform.Source[] {ad, rm};
-                rmSchema = factory.newSchema(schemas);
-            } catch (Exception ex) {
-                //ignore
-            }
-        }
-        return rmSchema;
-    }
-
     void createEndpoint(org.apache.cxf.transport.Destination d) {
         ServiceInfo si = service.getServiceInfo();
         buildBindingInfo(si);
@@ -295,9 +305,9 @@ public class RMEndpoint {
         }
 
         ei.setAddress(aei.getAddress());
-
-        ei.setName(RMConstants.getPortName());
-        ei.setBinding(si.getBinding(BINDING_NAME));
+        
+        ei.setName(RMUtils.getConstants(encoderDecoder.getWSRMNamespace()).getPortName());
+        ei.setBinding(si.getBinding(bindingQName));
 
         // if addressing was enabled on the application endpoint by means
         // of the UsingAddressing element extensor, use this for the
@@ -352,7 +362,8 @@ public class RMEndpoint {
     }
 
     void buildInterfaceInfo(ServiceInfo si) {
-        InterfaceInfo ii = new InterfaceInfo(si, INTERFACE_NAME);
+        interfaceQName = new QName(encoderDecoder.getWSRMNamespace(), INTERFACE_NAME);
+        InterfaceInfo ii = new InterfaceInfo(si, interfaceQName);
         buildOperationInfo(ii);
     }
 
@@ -360,7 +371,7 @@ public class RMEndpoint {
         buildCreateSequenceOperationInfo(ii);
         buildTerminateSequenceOperationInfo(ii);
         buildSequenceAckOperationInfo(ii);
-        buildLastMessageOperationInfo(ii);
+        buildCloseSequenceOperationInfo(ii);
         buildAckRequestedOperationInfo(ii);
 
         // TODO: FaultInfo (SequenceFault)
@@ -371,42 +382,42 @@ public class RMEndpoint {
         OperationInfo operationInfo = null;
         MessagePartInfo partInfo = null;
         MessageInfo messageInfo = null;
-
-        operationInfo = ii.addOperation(RMConstants.getCreateSequenceOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceOperationName(),
+        RMConstants consts = RMUtils.getConstants(encoderDecoder.getWSRMNamespace());
+        operationInfo = ii.addOperation(consts.getCreateSequenceOperationName());
+        messageInfo = operationInfo.createMessage(consts.getCreateSequenceOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
         partInfo = messageInfo.addMessagePart(CREATE_PART_NAME);
-        partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
+        partInfo.setElementQName(consts.getCreateSequenceOperationName());
         partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceType.class);
+        partInfo.setTypeClass(encoderDecoder.getCreateSequenceType());
 
-        messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceResponseOperationName(),
+        messageInfo = operationInfo.createMessage(consts.getCreateSequenceResponseOperationName(),
                                                   MessageInfo.Type.OUTPUT);
         operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo);
         partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME);
-        partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
+        partInfo.setElementQName(consts.getCreateSequenceResponseOperationName());
         partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceResponseType.class);
+        partInfo.setTypeClass(encoderDecoder.getCreateSequenceResponseType());
         partInfo.setIndex(0);
 
-        operationInfo = ii.addOperation(RMConstants.getCreateSequenceOnewayOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceOperationName(),
+        operationInfo = ii.addOperation(consts.getCreateSequenceOnewayOperationName());
+        messageInfo = operationInfo.createMessage(consts.getCreateSequenceOnewayOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
         partInfo = messageInfo.addMessagePart(CREATE_PART_NAME);
-        partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
+        partInfo.setElementQName(consts.getCreateSequenceOnewayOperationName());
         partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceType.class);
+        partInfo.setTypeClass(encoderDecoder.getCreateSequenceType());
 
-        operationInfo = ii.addOperation(RMConstants.getCreateSequenceResponseOnewayOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceResponseOperationName(),
+        operationInfo = ii.addOperation(consts.getCreateSequenceResponseOnewayOperationName());
+        messageInfo = operationInfo.createMessage(consts.getCreateSequenceResponseOnewayOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
         partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME);
-        partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
+        partInfo.setElementQName(consts.getCreateSequenceResponseOnewayOperationName());
         partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceResponseType.class);
+        partInfo.setTypeClass(encoderDecoder.getCreateSequenceResponseType());
     }
 
     void buildTerminateSequenceOperationInfo(InterfaceInfo ii) {
@@ -415,14 +426,15 @@ public class RMEndpoint {
         MessagePartInfo partInfo = null;
         MessageInfo messageInfo = null;
 
-        operationInfo = ii.addOperation(RMConstants.getTerminateSequenceOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getTerminateSequenceOperationName(),
+        RMConstants consts = RMUtils.getConstants(encoderDecoder.getWSRMNamespace());
+        operationInfo = ii.addOperation(consts.getTerminateSequenceOperationName());
+        messageInfo = operationInfo.createMessage(consts.getTerminateSequenceOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
         partInfo = messageInfo.addMessagePart(TERMINATE_PART_NAME);
-        partInfo.setElementQName(RMConstants.getTerminateSequenceOperationName());
+        partInfo.setElementQName(consts.getTerminateSequenceOperationName());
         partInfo.setElement(true);
-        partInfo.setTypeClass(TerminateSequenceType.class);
+        partInfo.setTypeClass(encoderDecoder.getTerminateSequenceType());
     }
 
     void buildSequenceAckOperationInfo(InterfaceInfo ii) {
@@ -430,19 +442,21 @@ public class RMEndpoint {
         OperationInfo operationInfo = null;
         MessageInfo messageInfo = null;
 
-        operationInfo = ii.addOperation(RMConstants.getSequenceAckOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getSequenceAckOperationName(),
+        RMConstants consts = RMUtils.getConstants(encoderDecoder.getWSRMNamespace());
+        operationInfo = ii.addOperation(consts.getSequenceAckOperationName());
+        messageInfo = operationInfo.createMessage(consts.getSequenceAckOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
     }
 
-    void buildLastMessageOperationInfo(InterfaceInfo ii) {
+    void buildCloseSequenceOperationInfo(InterfaceInfo ii) {
 
         OperationInfo operationInfo = null;
         MessageInfo messageInfo = null;
 
-        operationInfo = ii.addOperation(RMConstants.getLastMessageOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getLastMessageOperationName(),
+        RMConstants consts = RMUtils.getConstants(encoderDecoder.getWSRMNamespace());
+        operationInfo = ii.addOperation(consts.getCloseSequenceOperationName());
+        messageInfo = operationInfo.createMessage(consts.getCloseSequenceOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
     }
@@ -452,8 +466,9 @@ public class RMEndpoint {
         OperationInfo operationInfo = null;
         MessageInfo messageInfo = null;
 
-        operationInfo = ii.addOperation(RMConstants.getAckRequestedOperationName());
-        messageInfo = operationInfo.createMessage(RMConstants.getAckRequestedOperationName(),
+        RMConstants consts = RMUtils.getConstants(encoderDecoder.getWSRMNamespace());
+        operationInfo = ii.addOperation(consts.getAckRequestedOperationName());
+        messageInfo = operationInfo.createMessage(consts.getAckRequestedOperationName(),
                                                   MessageInfo.Type.INPUT);
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
     }
@@ -468,41 +483,43 @@ public class RMEndpoint {
             SoapVersion sv = sbi.getSoapVersion();
             String bindingId = sbi.getBindingId();
             SoapBindingInfo bi = new SoapBindingInfo(si, bindingId, sv);
-            bi.setName(BINDING_NAME);
+            bindingQName = new QName(encoderDecoder.getWSRMNamespace(), BINDING_NAME);
+            bi.setName(bindingQName);
             BindingOperationInfo boi = null;
 
-            boi = bi.buildOperation(RMConstants.getCreateSequenceOperationName(), RMConstants
-                .getCreateSequenceOperationName().getLocalPart(), null);
-            addAction(boi,
-                      RMConstants.getCreateSequenceAction(),
-                      RMConstants.getCreateSequenceResponseAction());
+            RMConstants consts = RMUtils.getConstants(encoderDecoder.getWSRMNamespace());
+            
+            boi = bi.buildOperation(consts.getCreateSequenceOperationName(),
+                                    consts.getCreateSequenceOperationName().getLocalPart(), null);
+            addAction(boi, consts.getCreateSequenceAction(), consts.getCreateSequenceResponseAction());
             bi.addOperation(boi);
 
-            boi = bi.buildOperation(RMConstants.getTerminateSequenceOperationName(), RMConstants
-                .getTerminateSequenceOperationName().getLocalPart(), null);
-            addAction(boi, RMConstants.getTerminateSequenceAction());
+            boi = bi.buildOperation(consts.getTerminateSequenceOperationName(),
+                                    consts.getTerminateSequenceOperationName().getLocalPart(), null);
+            addAction(boi, consts.getTerminateSequenceAction());
             bi.addOperation(boi);
 
-            boi = bi.buildOperation(RMConstants.getSequenceAckOperationName(), null, null);
-            addAction(boi, RMConstants.getSequenceAckAction());
+            boi = bi.buildOperation(consts.getSequenceAckOperationName(), null, null);
+            addAction(boi, consts.getSequenceAckAction());
             bi.addOperation(boi);
 
-            boi = bi.buildOperation(RMConstants.getLastMessageOperationName(), null, null);
-            addAction(boi, RMConstants.getLastMessageAction());
+            boi = bi.buildOperation(consts.getCloseSequenceOperationName(), null, null);
+            addAction(boi, consts.getCloseSequenceAction());
             bi.addOperation(boi);
 
-            boi = bi.buildOperation(RMConstants.getAckRequestedOperationName(), null, null);
-            addAction(boi, RMConstants.getAckRequestedAction());
+            boi = bi.buildOperation(consts.getAckRequestedOperationName(), null, null);
+            addAction(boi, consts.getAckRequestedAction());
             bi.addOperation(boi);
 
-            boi = bi.buildOperation(RMConstants.getCreateSequenceOnewayOperationName(), RMConstants
-                .getCreateSequenceOperationName().getLocalPart(), null);
-            addAction(boi, RMConstants.getCreateSequenceAction());
+            boi = bi.buildOperation(consts.getCreateSequenceOnewayOperationName(),
+                                    consts.getCreateSequenceOnewayOperationName().getLocalPart(), null);
+            addAction(boi, consts.getCreateSequenceAction());
             bi.addOperation(boi);
 
-            boi = bi.buildOperation(RMConstants.getCreateSequenceResponseOnewayOperationName(), RMConstants
-                .getCreateSequenceResponseOperationName().getLocalPart(), null);
-            addAction(boi, RMConstants.getCreateSequenceResponseAction());
+            boi = bi.buildOperation(consts.getCreateSequenceResponseOnewayOperationName(),
+                                    consts.getCreateSequenceResponseOnewayOperationName().getLocalPart(),
+                                    null);
+            addAction(boi, consts.getCreateSequenceResponseAction());
             bi.addOperation(boi);
 
             si.addBinding(bi);

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=1137112&r1=1137111&r2=1137112&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 Sat Jun 18 01:51:01 2011
@@ -28,6 +28,8 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
 import org.apache.cxf.ws.addressing.ContextUtils;
 import org.apache.cxf.ws.addressing.MAPAggregator;
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 
 /**
  * 
@@ -89,7 +91,7 @@ public class RMInInterceptor extends Abs
         
         if (isApplicationMessage) {                        
             if (null != rmps) {
-                processAcknowledgments(rme.getSource(), rmps);
+                processAcknowledgments(rme, rmps);
                 processAcknowledgmentRequests(destination, message);
                 processSequence(destination, message);
                 processDeliveryAssurance(rmps);
@@ -102,14 +104,17 @@ public class RMInInterceptor extends Abs
             }
         } else {
             rme.receivedControlMessage();
-            if (RMConstants.getSequenceAckAction().equals(action)) {
-                processAcknowledgments(rme.getSource(), rmps);
-            } else if (RMConstants.getLastMessageAction().equals(action)) {
+            if (RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)
+                || RM11Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)) {
+                processAcknowledgments(rme, rmps);
+            } else if (RM10Constants.CLOSE_SEQUENCE_ACTION.equals(action)
+                || RM11Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)) {
                 processSequence(destination, message);
-            } else if (RMConstants.getCreateSequenceAction().equals(action) && !isServer) {
+            } else if ((RM10Constants.CREATE_SEQUENCE_ACTION.equals(action)
+                || RM11Constants.CREATE_SEQUENCE_ACTION.equals(action)) && !isServer) {
                 LOG.fine("Processing inbound CreateSequence on client side.");
                 Servant servant = rme.getServant();
-                CreateSequenceResponseType csr = servant.createSequence(message);
+                Object csr = servant.createSequence(message);
                 Proxy proxy = rme.getProxy();
                 proxy.createSequenceResponse(csr);
                 return;
@@ -119,9 +124,10 @@ public class RMInInterceptor extends Abs
         assertReliability(message);
     }
     
-    void processAcknowledgments(Source source, RMProperties rmps) throws SequenceFault, RMException {
+    void processAcknowledgments(RMEndpoint rme, RMProperties rmps) throws SequenceFault, RMException {
         
         Collection<SequenceAcknowledgement> acks = rmps.getAcks();
+        Source source = rme.getSource();
         if (null != acks) {
             for (SequenceAcknowledgement ack : acks) {
                 Identifier id = ack.getIdentifier();
@@ -129,7 +135,9 @@ public class RMInInterceptor extends Abs
                 if (null != ss) {
                     ss.setAcknowledged(ack);
                 } else {
-                    throw (new SequenceFaultFactory()).createUnknownSequenceFault(id);
+                    RMConstants consts = rme.getEncoderDecoder().getConstants();
+                    SequenceFaultFactory sff = new SequenceFaultFactory(consts);
+                    throw sff.createUnknownSequenceFault(id);
                 }
             }
         }

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=1137112&r1=1137111&r2=1137112&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 Sat Jun 18 01:51:01 2011
@@ -53,27 +53,44 @@ import org.apache.cxf.service.model.Serv
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.MAPAggregator;
+import org.apache.cxf.ws.addressing.Names;
 import org.apache.cxf.ws.addressing.RelatesToType;
-import org.apache.cxf.ws.addressing.VersionTransformer;
-import org.apache.cxf.ws.addressing.v200408.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.VersionTransformer.Names200408;
 import org.apache.cxf.ws.rm.manager.DeliveryAssuranceType;
 import org.apache.cxf.ws.rm.manager.DestinationPolicyType;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
 import org.apache.cxf.ws.rm.persistence.RMMessage;
 import org.apache.cxf.ws.rm.persistence.RMStore;
-import org.apache.cxf.ws.rm.policy.RMAssertion;
-import org.apache.cxf.ws.rm.policy.RMAssertion.BaseRetransmissionInterval;
 import org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl;
 import org.apache.cxf.ws.rm.soap.SoapFaultFactory;
+import org.apache.cxf.ws.rm.v200702.CloseSequenceType;
+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;
 
 /**
  * 
  */
 public class RMManager implements ServerLifeCycleListener, ClientLifeCycleListener {
+    
+    /**
+     * Message contextual property giving WS-ReliableMessaging namespace.
+     */
+    public static final String WSRM_VERSION_PROPERTY = "org.apache.cxf.ws.rm.namespace";
+    
+    /**
+     * Message contextual property giving addressing namespace to be used by WS-RM implementation.
+     */
+    public static final String WSRM10_WSA_VERSION_PROPERTY = "org.apache.cxf.ws.rm.wsa-namespace";
 
     private static final Logger LOG = LogUtils.getL7dLogger(RMManager.class);
 
+
     private Bus bus;
     private RMStore store;
     private SequenceIdentifierGenerator idGenerator;
@@ -84,6 +101,8 @@ public class RMManager implements Server
     private DeliveryAssuranceType deliveryAssurance;
     private SourcePolicyType sourcePolicy;
     private DestinationPolicyType destinationPolicy;
+    private String rmNamespace = RM10Constants.NAMESPACE_URI;
+    private String rmAddressingNamespace = Names200408.WSA_NAMESPACE_NAME;
     
     // ServerLifeCycleListener
     
@@ -117,6 +136,22 @@ public class RMManager implements Server
     }
 
     // Configuration
+
+    public String getRMNamespace() {
+        return rmNamespace;
+    }
+
+    public void setRMNamespace(String uri) {
+        rmNamespace = uri;
+    }
+
+    public String getRMAddressingNamespace() {
+        return rmAddressingNamespace;
+    }
+
+    public void setRMAddressingNamespace(String uri) {
+        rmAddressingNamespace = uri;
+    }
     
     public Bus getBus() {
         return bus;
@@ -211,14 +246,13 @@ public class RMManager implements Server
      * @param rma The rmAssertion to set.
      */
     public void setRMAssertion(RMAssertion rma) {
-        org.apache.cxf.ws.rm.policy.ObjectFactory factory = new org.apache.cxf.ws.rm.policy.ObjectFactory();
         if (null == rma) {
-            rma = factory.createRMAssertion();
-            rma.setExponentialBackoff(factory.createRMAssertionExponentialBackoff());
+            rma = new RMAssertion();
+            rma.setExponentialBackoff(new ExponentialBackoff());
         }
         BaseRetransmissionInterval bri = rma.getBaseRetransmissionInterval();
         if (null == bri) {
-            bri = factory.createRMAssertionBaseRetransmissionInterval();
+            bri = new BaseRetransmissionInterval();
             rma.setBaseRetransmissionInterval(bri);
         }
         if (null == bri.getMilliseconds()) {
@@ -243,7 +277,7 @@ public class RMManager implements Server
         if (null == sp) {
             sp = factory.createSourcePolicyType();
         }
-        if (!sp.isSetSequenceTerminationPolicy()) {
+        if (sp.getSequenceTerminationPolicy() == null) {
             sp.setSequenceTerminationPolicy(factory.createSequenceTerminationPolicyType());
         }
         sourcePolicy = sp;
@@ -257,15 +291,35 @@ public class RMManager implements Server
         if (LOG.isLoggable(Level.FINE)) {
             LOG.fine("Getting RMEndpoint for endpoint with info: " + name);
         }
-        if (name.equals(RMConstants.getPortName())) {
+        if (name.equals(RM10Constants.PORT_NAME) || name.equals(RM11Constants.PORT_NAME)) {
             WrappedEndpoint wrappedEndpoint = (WrappedEndpoint)endpoint;
             endpoint = wrappedEndpoint.getWrappedEndpoint();
         }
         RMEndpoint rme = reliableEndpoints.get(endpoint);
         if (null == rme) {
-            rme = createReliableEndpoint(endpoint);
+            RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
+            String rmUri = null;
+            if (rmps != null) {
+                rmUri = rmps.getNamespaceURI();
+            }
+            if (rmUri == null) {
+                rmUri = getRMNamespace();
+            }
+            String addrUri = null;
+            if (RM10Constants.NAMESPACE_URI.equals(rmUri)) {
+                AddressingPropertiesImpl maps = RMContextUtils.retrieveMAPs(message, false, false);
+                if (maps != null) {
+                    addrUri = maps.getNamespaceURI();
+                }
+                if (addrUri == null) {
+                    addrUri = getRMAddressingNamespace();
+                }
+            } else {
+                addrUri = Names.WSA_ADDRESS_NAME;
+            }
+            rme = createReliableEndpoint(endpoint, VersionTransformer.getEncoderDecoder(rmUri, addrUri));
             org.apache.cxf.transport.Destination destination = message.getExchange().getDestination();
-            org.apache.cxf.ws.addressing.EndpointReferenceType replyTo = null;
+            EndpointReferenceType replyTo = null;
             if (null != destination) {
                 AddressingPropertiesImpl maps = RMContextUtils.retrieveMAPs(message, false, false);
                 replyTo = maps.getReplyTo();
@@ -299,21 +353,21 @@ public class RMManager implements Server
     }
 
     public SourceSequence getSequence(Identifier inSeqId, Message message, AddressingProperties maps)
-        throws SequenceFault, RMException {
+        throws RMException {
 
         Source source = getSource(message);
         SourceSequence seq = source.getCurrent(inSeqId);
         if (null == seq || seq.isExpired()) {
             // TODO: better error handling
-            org.apache.cxf.ws.addressing.EndpointReferenceType to = null;
+            EndpointReferenceType to = null;
             boolean isServer = RMContextUtils.isServerSide(message);
             EndpointReferenceType acksTo = null;
             RelatesToType relatesTo = null;
             if (isServer) {
 
                 AddressingPropertiesImpl inMaps = RMContextUtils.retrieveMAPs(message, false, false);
-                inMaps.exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
-                acksTo = RMUtils.createReference2004(inMaps.getTo().getValue());
+                inMaps.exposeAs(getRMAddressingNamespace());
+                acksTo = RMUtils.createReference(inMaps.getTo().getValue());
                 to = inMaps.getReplyTo();
                 source.getReliableEndpoint().getServant().setUnattachedIdentifier(inSeqId);
                 relatesTo = (new org.apache.cxf.ws.addressing.ObjectFactory()).createRelatesToType();
@@ -323,17 +377,17 @@ public class RMManager implements Server
 
             } else {
                 to = RMUtils.createReference(maps.getTo().getValue());
-                acksTo = VersionTransformer.convert(maps.getReplyTo());
-                if (RMConstants.getNoneAddress().equals(acksTo.getAddress().getValue())) {
+                acksTo = maps.getReplyTo();
+                if (RMUtils.getAddressingConstants().getNoneURI().equals(acksTo.getAddress().getValue())) {
                     Endpoint ei = message.getExchange().get(Endpoint.class);
                     org.apache.cxf.transport.Destination dest 
                         = ei == null ? null : ei.getEndpointInfo()
                                 .getProperty(MAPAggregator.DECOUPLED_DESTINATION, 
                                          org.apache.cxf.transport.Destination.class);
                     if (null == dest) {
-                        acksTo = RMUtils.createAnonymousReference2004();
+                        acksTo = RMUtils.createAnonymousReference();
                     } else {
-                        acksTo = VersionTransformer.convert(dest.getAddress());
+                        acksTo = dest.getAddress();
                     }
                 }
             }
@@ -350,7 +404,7 @@ public class RMManager implements Server
         }
 
         return seq;
-    }    
+    }
 
     @PreDestroy
     public void shutdown() {
@@ -407,7 +461,7 @@ public class RMManager implements Server
         
         LOG.log(Level.FINE, "Recovering {0} endpoint with id: {1}",
                 new Object[] {null == conduit ? "client" : "server", id});
-        RMEndpoint rme = createReliableEndpoint(endpoint);
+        RMEndpoint rme = createReliableEndpoint(endpoint, null);
         rme.initialise(conduit, null, null);
         reliableEndpoints.put(endpoint, rme);
         SourceSequence css = null;
@@ -447,11 +501,13 @@ public class RMManager implements Server
                 SequenceType st = RMUtils.getWSRMFactory().createSequenceType();
                 st.setIdentifier(ss.getIdentifier());
                 st.setMessageNumber(m.getMessageNumber());
-                if (ss.isLastMessage() && ss.getCurrentMessageNr() == m.getMessageNumber()) {
-                    st.setLastMessage(RMUtils.getWSRMFactory().createSequenceTypeLastMessage());
-                }
                 RMProperties rmps = new RMProperties();
                 rmps.setSequence(st);
+                if (ss.isLastMessage() && ss.getCurrentMessageNr() == m.getMessageNumber()) {
+                    CloseSequenceType close = RMUtils.getWSRMFactory().createCloseSequenceType();
+                    close.setIdentifier(ss.getIdentifier());
+                    rmps.setCloseSequence(close);
+                }
                 RMContextUtils.storeRMProperties(message, rmps, true);                
                 if (null == conduit) {
                     String to = m.getTo();
@@ -473,8 +529,8 @@ public class RMManager implements Server
         
     }
     
-    RMEndpoint createReliableEndpoint(Endpoint endpoint) {
-        return new RMEndpoint(this, endpoint);
+    RMEndpoint createReliableEndpoint(Endpoint endpoint, EncoderDecoder codec) {
+        return new RMEndpoint(this, endpoint, codec);
     }  
     
     public void init(Bus b) {
@@ -493,14 +549,12 @@ public class RMManager implements Server
         if (null == deliveryAssurance) {
             da.setAtLeastOnce(factory.createDeliveryAssuranceTypeAtLeastOnce());
             setDeliveryAssurance(da);
-        } else if (deliveryAssurance.isSetExactlyOnce()) {
-            if (!deliveryAssurance.isSetAtMostOnce()) {
-                deliveryAssurance.setAtMostOnce(
-                    factory.createDeliveryAssuranceTypeAtMostOnce());
-            }
-            if (!deliveryAssurance.isSetAtLeastOnce()) {
-                deliveryAssurance.setAtLeastOnce(
-                    factory.createDeliveryAssuranceTypeAtLeastOnce());
+        } else if (deliveryAssurance.getExactlyOnce() != null) {
+            if (deliveryAssurance.getAtMostOnce() == null) {
+                deliveryAssurance.setAtMostOnce(factory.createDeliveryAssuranceTypeAtMostOnce());
+            }
+            if (deliveryAssurance.getAtLeastOnce() == null) {
+                deliveryAssurance.setAtLeastOnce(factory.createDeliveryAssuranceTypeAtLeastOnce());
             }
         }
         if (null == sourcePolicy) {
@@ -553,7 +607,4 @@ public class RMManager implements Server
             return sid;
         }
     }
-
-    
-
-}
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java Sat Jun 18 01:51:01 2011
@@ -28,12 +28,12 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.message.FaultMode;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageUtils;
-import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
 import org.apache.cxf.ws.addressing.AttributedURIType;
 import org.apache.cxf.ws.addressing.ContextUtils;
 import org.apache.cxf.ws.addressing.MAPAggregator;
-import org.apache.cxf.ws.addressing.VersionTransformer;
-import org.apache.cxf.ws.addressing.v200408.AttributedURI;
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 
 /**
  * 
@@ -46,8 +46,8 @@ public class RMOutInterceptor extends Ab
         addAfter(MAPAggregator.class.getName());
     }
     
-    protected void handle(Message message) throws SequenceFault, RMException {  
-        if (isRuntimeFault(message)) {
+    protected void handle(Message msg) throws SequenceFault, RMException {  
+        if (isRuntimeFault(msg)) {
             LogUtils.log(LOG, Level.WARNING, "RUNTIME_FAULT_MSG");
             // TODO: in case of a SequenceFault need to set action
             // to http://schemas.xmlsoap.org/ws/2004/a08/addressing/fault
@@ -55,20 +55,19 @@ public class RMOutInterceptor extends Ab
             return;
         }
        
-        AddressingProperties maps =
-            RMContextUtils.retrieveMAPs(message, false, true);
+        AddressingPropertiesImpl maps =
+            RMContextUtils.retrieveMAPs(msg, false, true);
         if (null == maps) {
             LogUtils.log(LOG, Level.WARNING, "MAPS_RETRIEVAL_FAILURE_MSG");
             return;
         }
+        maps.exposeAs(getManager().getRMAddressingNamespace());
         
-        RMContextUtils.ensureExposedVersion(maps);
-        
-        Source source = getManager().getSource(message);
-        Destination destination = getManager().getDestination(message);
+        Source source = getManager().getSource(msg);
+        Destination destination = getManager().getDestination(msg);
 
         String action = null;
-        if (maps != null && null != maps.getAction()) {
+        if (null != maps.getAction()) {
             action = maps.getAction().getValue();
         }
         
@@ -77,8 +76,9 @@ public class RMOutInterceptor extends Ab
         }
 
         boolean isApplicationMessage = !RMContextUtils.isRMProtocolMessage(action);
-        boolean isPartialResponse = MessageUtils.isPartialResponse(message);
-        boolean isLastMessage = RMConstants.getLastMessageAction().equals(action);
+        boolean isPartialResponse = MessageUtils.isPartialResponse(msg);
+        boolean isLastMessage = RM10Constants.CLOSE_SEQUENCE_ACTION.equals(action)
+            || RM11Constants.CLOSE_SEQUENCE_ACTION.equals(action);
         
         if (isApplicationMessage && !isPartialResponse) {
             RetransmissionInterceptor ri = new RetransmissionInterceptor();
@@ -88,16 +88,32 @@ public class RMOutInterceptor extends Ab
             // interceptor chains (if this is not already a fault message) and therefore need to 
             // make sure the retransmission interceptor is added to the fault chain
             // 
-            message.getInterceptorChain().add(ri);
+            msg.getInterceptorChain().add(ri);
             LOG.fine("Added RetransmissionInterceptor to chain.");
             
             getManager().getRetransmissionQueue().start();
         }
         
-        RMProperties rmpsOut = (RMProperties)RMContextUtils.retrieveRMProperties(message, true);
+        RMProperties rmpsOut = RMContextUtils.retrieveRMProperties(msg, true);
         if (null == rmpsOut) {
             rmpsOut = new RMProperties();
-            RMContextUtils.storeRMProperties(message, rmpsOut, true);
+            String uri = null;
+            if (RMContextUtils.isServerSide(msg)) {
+                RMProperties rmpsIn = RMContextUtils
+                    .retrieveRMProperties(msg.getExchange().getInMessage(), false);
+                uri = rmpsIn.getNamespaceURI();
+            } else {
+                uri = (String)msg.getContextualProperty(RMManager.WSRM_VERSION_PROPERTY);
+            }
+            if (uri != null && RMUtils.getConstants(uri) == null) {
+                LogUtils.log(LOG, Level.WARNING, "Ignoring unknown WS-RM namespace: " + uri);
+                uri = null;
+            }
+            if (uri == null) {
+                uri = getManager().getRMNamespace();
+            }
+            rmpsOut.exposeAs(uri);
+            RMContextUtils.storeRMProperties(msg, rmpsOut, true);
         }
         
         RMProperties rmpsIn = null;
@@ -105,12 +121,12 @@ public class RMOutInterceptor extends Ab
         long inMessageNumber = 0;
         
         if (isApplicationMessage) {
-            rmpsIn = (RMProperties)RMContextUtils.retrieveRMProperties(message, false);
+            rmpsIn = RMContextUtils.retrieveRMProperties(msg, false);
             if (null != rmpsIn && null != rmpsIn.getSequence()) {
                 inSeqId = rmpsIn.getSequence().getIdentifier();
                 inMessageNumber = rmpsIn.getSequence().getMessageNumber();
             }
-            ContextUtils.storeDeferUncorrelatedMessageAbort(message);
+            ContextUtils.storeDeferUncorrelatedMessageAbort(msg);
         }
         
         if ((isApplicationMessage || isLastMessage)
@@ -124,10 +140,10 @@ public class RMOutInterceptor extends Ab
             synchronized (source) {
                 SourceSequence seq = null;
                 if (isLastMessage) {
-                    Map<?, ?> invocationContext = (Map)message.get(Message.INVOCATION_CONTEXT);
+                    Map<?, ?> invocationContext = (Map)msg.get(Message.INVOCATION_CONTEXT);
                     seq = (SourceSequence)invocationContext.get(SourceSequence.class.getName());
                 } else {
-                    seq = getManager().getSequence(inSeqId, message, maps);
+                    seq = getManager().getSequence(inSeqId, msg, maps);
                 }
                 assert null != seq;
 
@@ -147,39 +163,44 @@ public class RMOutInterceptor extends Ab
                 }
             }
         } else {
-            if (!MessageUtils.isRequestor(message)
-                && RMConstants.getCreateSequenceAction().equals(action)) {
-                maps.getAction().setValue(RMConstants.getCreateSequenceResponseAction());
+            if (!MessageUtils.isRequestor(msg)) {
+                if (RM10Constants.CREATE_SEQUENCE_ACTION.equals(action)) {
+                    maps.getAction().setValue(RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION);
+                } else if (RM11Constants.CREATE_SEQUENCE_ACTION.equals(action)) {
+                    maps.getAction().setValue(RM11Constants.CREATE_SEQUENCE_RESPONSE_ACTION);
+                }
             }
         }
         
         // add Acknowledgements (to application messages or explicitly 
         // created Acknowledgement messages only)
-
-        if (isApplicationMessage 
-            || RMConstants.getSequenceAcknowledgmentAction().equals(action)) {
-            AttributedURI to = VersionTransformer.convert(maps.getTo());
+        if (isApplicationMessage || RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)
+            || RM11Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)) {
+            AttributedURIType to = maps.getTo();
             assert null != to;
             addAcknowledgements(destination, rmpsOut, inSeqId, to);
             if (isPartialResponse && rmpsOut.getAcks() != null && rmpsOut.getAcks().size() > 0) {
                 AttributedURIType actionURI = new AttributedURIType();
-                actionURI.setValue(RMConstants.getSequenceAcknowledgmentAction());
+                actionURI.setValue(RMUtils.getConstants(rmpsOut.getNamespaceURI())
+                                   .getSequenceAckAction());
                 maps.setAction(actionURI);
             }
         } 
         
-        if (RMConstants.getSequenceAckAction().equals(action)
-            || RMConstants.getTerminateSequenceAction().equals(action)) {
+        if (RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)
+            || RM11Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION.equals(action)
+            || RM10Constants.TERMINATE_SEQUENCE_ACTION.equals(action)
+            || RM11Constants.TERMINATE_SEQUENCE_ACTION.equals(action)) {
             maps.setReplyTo(RMUtils.createNoneReference());
         }
         
-        assertReliability(message);
+        assertReliability(msg);
     }
     
     void addAcknowledgements(Destination destination, 
                              RMProperties rmpsOut, 
                              Identifier inSeqId, 
-                             AttributedURI to) {
+                             AttributedURIType to) {
         for (DestinationSequence seq : destination.getAllSequences()) {
             if (!seq.sendAcknowledgement()) {
                 if (LOG.isLoggable(Level.FINE)) {
@@ -188,15 +209,16 @@ public class RMOutInterceptor extends Ab
                 }
                 continue;
             }
-            if (!to.getValue().equals(seq.getAcksTo().getAddress().getValue())) {
+            String address = seq.getAcksTo().getAddress().getValue();
+            if (!to.getValue().equals(address)) {
                 if (LOG.isLoggable(Level.FINE)) {
-                    LOG.fine("sequences acksTo address (" + seq.getAcksTo().getAddress().getValue()
+                    LOG.fine("sequences acksTo address (" + address
                         + ") does not match to address (" + to.getValue() + ")");
                 }
                 continue;
             }
             // there may be multiple sources with anonymous acksTo 
-            if (RMConstants.getAnonymousAddress().equals(seq.getAcksTo().getAddress().getValue())
+            if (RMUtils.getAddressingConstants().getAnonymousURI().equals(address)
                 && !AbstractSequence.identifierEquals(seq.getIdentifier(), inSeqId)) {                
                 if (LOG.isLoggable(Level.FINE)) {
                     LOG.fine("sequence identifier does not match inbound sequence identifier");

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMProperties.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMProperties.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMProperties.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMProperties.java Sat Jun 18 01:51:01 2011
@@ -23,10 +23,17 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.apache.cxf.ws.rm.v200702.AckRequestedType;
+import org.apache.cxf.ws.rm.v200702.CloseSequenceType;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.v200702.SequenceType;
+
 public class RMProperties {
     private SequenceType sequence;
     private Collection<SequenceAcknowledgement> acks;
     private Collection<AckRequestedType> acksRequested;
+    private CloseSequenceType closeSequence;
+    private String namespaceURI;
     
     public Collection<SequenceAcknowledgement> getAcks() {
         return acks;
@@ -36,6 +43,10 @@ public class RMProperties {
         return acksRequested;
     }
     
+    public CloseSequenceType getCloseSequence() {
+        return closeSequence;
+    }
+    
     public SequenceType getSequence() {
         return sequence;
     }
@@ -50,6 +61,10 @@ public class RMProperties {
         acksRequested = new CopyOnWriteArrayList<AckRequestedType>(ar);       
     }
     
+    public void setCloseSequence(CloseSequenceType cs) {
+        closeSequence = cs;
+    }
+    
     public void setSequence(SequenceType s) {
         sequence = s;
     }
@@ -58,9 +73,6 @@ public class RMProperties {
         SequenceType s = RMUtils.getWSRMFactory().createSequenceType();
         s.setIdentifier(seq.getIdentifier());
         s.setMessageNumber(seq.getCurrentMessageNr());   
-        if (seq.isLastMessage()) {
-            s.setLastMessage(new SequenceType.LastMessage());
-        }
         setSequence(s);
     }
     
@@ -72,5 +84,22 @@ public class RMProperties {
         acks.add(ack);
         seq.acknowledgmentSent();
     }
-  
-}
+    
+    /**
+     * Get the WS-ReliableMessaging namespace to be used for encoding and decoding messages.
+     * 
+     * @return
+     */
+    public String getNamespaceURI() {
+        return namespaceURI;
+    }
+    
+    /**
+     * Set the WS-ReliableMessaging namespace to be used for encoding and decoding messages.
+     * 
+     * @return namespace URI
+     */
+    public void exposeAs(String uri) {
+        namespaceURI = uri;
+    }
+}
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMUtils.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMUtils.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMUtils.java Sat Jun 18 01:51:01 2011
@@ -20,58 +20,85 @@
 package org.apache.cxf.ws.rm;
 
 import java.io.OutputStream;
-import java.text.MessageFormat;
 
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.io.WriteOnCloseOutputStream;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.addressing.AddressingConstants;
 import org.apache.cxf.ws.addressing.AddressingConstantsImpl;
-import org.apache.cxf.ws.addressing.VersionTransformer;
 
 public final class RMUtils {
    
-    private static final org.apache.cxf.ws.addressing.v200408.ObjectFactory WSA_FACTORY;
-    private static final org.apache.cxf.ws.rm.ObjectFactory WSRM_FACTORY;
+    private static final org.apache.cxf.ws.rm.v200702.ObjectFactory WSRM_FACTORY;
+    private static final org.apache.cxf.ws.rm.v200502.ObjectFactory WSRM200502_FACTORY;
+    private static final org.apache.cxf.ws.rm.v200502wsa15.ObjectFactory WSRM200502_WSA200508_FACTORY;
     private static final AddressingConstants WSA_CONSTANTS; 
     
     static {
-        WSA_FACTORY = new org.apache.cxf.ws.addressing.v200408.ObjectFactory();
-        WSRM_FACTORY = new org.apache.cxf.ws.rm.ObjectFactory();        
-        WSA_CONSTANTS = new AddressingConstantsImpl();      
+        WSRM_FACTORY = new org.apache.cxf.ws.rm.v200702.ObjectFactory();        
+        WSRM200502_FACTORY = new org.apache.cxf.ws.rm.v200502.ObjectFactory();
+        WSRM200502_WSA200508_FACTORY = new org.apache.cxf.ws.rm.v200502wsa15.ObjectFactory();
+        WSA_CONSTANTS = new AddressingConstantsImpl();
     }
     
-    protected RMUtils() {        
+    private RMUtils() {        
     }
     
-    public static org.apache.cxf.ws.addressing.v200408.ObjectFactory getWSAFactory() {
-        return WSA_FACTORY;
+    /**
+     * Get the factory for the internal representation of WS-RM data (WS-ReliableMessaging 1.1).
+     * 
+     * @return factory
+     */
+    public static org.apache.cxf.ws.rm.v200702.ObjectFactory getWSRMFactory() {
+        return WSRM_FACTORY;
     }
     
-    public static org.apache.cxf.ws.rm.ObjectFactory getWSRMFactory() {
-        return WSRM_FACTORY;
+    /**
+     * Get the factory for WS-ReliableMessaging 1.0 using the standard 200408 WS-Addressing namespace.
+     * 
+     * @return factory
+     */
+    public static org.apache.cxf.ws.rm.v200502.ObjectFactory getWSRM200502Factory() {
+        return WSRM200502_FACTORY;
+    }
+    
+    /**
+     * Get the factory for WS-ReliableMessaging 1.0 using the current 200508 WS-Addressing namespace.
+     * 
+     * @return factory
+     */
+    public static org.apache.cxf.ws.rm.v200502wsa15.ObjectFactory getWSRM200502WSA200508Factory() {
+        return WSRM200502_WSA200508_FACTORY;
+    }
+    
+    /**
+     * Get the constants for a particular WS-ReliableMessaging namespace.
+     * 
+     * @param uri
+     * @return constants
+     */
+    public static RMConstants getConstants(String uri) {
+        if (RM10Constants.NAMESPACE_URI.equals(uri)) {
+            return RM10Constants.INSTANCE;
+        } else if (RM11Constants.NAMESPACE_URI.equals(uri)) {
+            return RM11Constants.INSTANCE;
+        } else {
+            return null;
+        }
     }
     
     public static AddressingConstants getAddressingConstants() {
         return WSA_CONSTANTS;
     }
-    
+
     public static org.apache.cxf.ws.addressing.EndpointReferenceType createAnonymousReference() {
         return createReference(org.apache.cxf.ws.addressing.Names.WSA_ANONYMOUS_ADDRESS);
     }
     
-    public static org.apache.cxf.ws.addressing.v200408.EndpointReferenceType createAnonymousReference2004() {
-        return VersionTransformer.convert(createAnonymousReference());
-    }
-    
     public static org.apache.cxf.ws.addressing.EndpointReferenceType createNoneReference() {
         return createReference(org.apache.cxf.ws.addressing.Names.WSA_NONE_ADDRESS);
     }
     
-    public static org.apache.cxf.ws.addressing.v200408.EndpointReferenceType createNoneReference2004() {
-        return VersionTransformer.convert(createNoneReference());
-    }
-    
     public static org.apache.cxf.ws.addressing.EndpointReferenceType createReference(String address) {
         org.apache.cxf.ws.addressing.ObjectFactory factory = 
             new org.apache.cxf.ws.addressing.ObjectFactory();
@@ -82,23 +109,9 @@ public final class RMUtils {
         return epr;        
     }
     
-    public static org.apache.cxf.ws.addressing.v200408.EndpointReferenceType 
-    createReference2004(String address) {
-        org.apache.cxf.ws.addressing.v200408.ObjectFactory factory = 
-            new org.apache.cxf.ws.addressing.v200408.ObjectFactory();
-        org.apache.cxf.ws.addressing.v200408.EndpointReferenceType epr = 
-            factory.createEndpointReferenceType();
-        org.apache.cxf.ws.addressing.v200408.AttributedURI uri = factory.createAttributedURI();
-        uri.setValue(address);
-        epr.setAddress(uri);
-        return epr;
-    } 
-    
     public static String getEndpointIdentifier(Endpoint endpoint) {
-        return MessageFormat.format("{0}.{1}", new Object[] {
-            endpoint.getEndpointInfo().getService().getName(),
-            endpoint.getEndpointInfo().getName()
-        });
+        return endpoint.getEndpointInfo().getService().getName() + "."
+            + endpoint.getEndpointInfo().getName();
     }
     
     public static WriteOnCloseOutputStream createCachedStream(Message message, OutputStream os) {

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RetransmissionCallback.java Sat Jun 18 01:51:01 2011
@@ -28,6 +28,7 @@ import org.apache.cxf.message.MessageUti
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.rm.persistence.RMMessage;
 import org.apache.cxf.ws.rm.persistence.RMStore;
+import org.apache.cxf.ws.rm.v200702.Identifier;
 
 /**
  * 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java Sat Jun 18 01:51:01 2011
@@ -21,6 +21,8 @@ package org.apache.cxf.ws.rm;
 
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
+
 /**
  * 
  */
@@ -56,7 +58,7 @@ public class SequenceFault extends Excep
     }
     
     public QName getSubCode() {
-        return sequenceFault.faultCode;
+        return sequenceFault.getFaultCode();
     }
     
     public String getReason() {

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java Sat Jun 18 01:51:01 2011
@@ -23,18 +23,26 @@ import java.util.ResourceBundle;
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
-
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
 /**
  * Utility class to construct SequenceFaults.
  */
 
-class SequenceFaultFactory { 
+class SequenceFaultFactory {
 
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(SequenceFaultFactory.class);
     
+    private final RMConstants constants;
+    
+    SequenceFaultFactory(RMConstants consts) {
+        constants = consts;
+    }
+    
     SequenceFault createUnknownSequenceFault(Identifier sid) {
         SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(RMConstants.getUnknownSequenceFaultCode());
+        sf.setFaultCode(constants.getUnknownSequenceFaultCode());
         Message msg = new Message("UNKNOWN_SEQ_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
         fault.setSequenceFault(sf);
@@ -45,7 +53,7 @@ class SequenceFaultFactory { 
     
     SequenceFault createSequenceTerminatedFault(Identifier sid, boolean sender) {
         SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(RMConstants.getSequenceTerminatedFaultCode());
+        sf.setFaultCode(constants.getSequenceTerminatedFaultCode());
         Message msg = new Message("SEQ_TERMINATED_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
         fault.setSequenceFault(sf);
@@ -56,7 +64,7 @@ class SequenceFaultFactory { 
     
     SequenceFault createInvalidAcknowledgementFault(SequenceAcknowledgement ack) {
         SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(RMConstants.getInvalidAcknowledgmentFaultCode());
+        sf.setFaultCode(constants.getInvalidAcknowledgmentFaultCode());
         Message msg = new Message("INVALID_ACK_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
         fault.setSequenceFault(sf);
@@ -67,7 +75,7 @@ class SequenceFaultFactory { 
     
     SequenceFault createMessageNumberRolloverFault(Identifier sid) {
         SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(RMConstants.getMessageNumberRolloverFaultCode());
+        sf.setFaultCode(constants.getMessageNumberRolloverFaultCode());
         Message msg = new Message("MESSAGE_NR_ROLLOVER_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
         fault.setSequenceFault(sf);
@@ -76,20 +84,9 @@ class SequenceFaultFactory { 
         return fault;
     }
     
-    SequenceFault createLastMessageNumberExceededFault(Identifier sid) {
-        SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(RMConstants.getLastMessageNumberExceededFaultCode());
-        Message msg = new Message("LAST_MESSAGE_NUMBER_EXCEEDED_EXC", BUNDLE);
-        SequenceFault fault = new SequenceFault(msg.toString());
-        fault.setSequenceFault(sf);
-        fault.setDetail(sid);
-        fault.setSender(true);
-        return fault;
-    }
-    
     SequenceFault createCreateSequenceRefusedFault() {
         SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(RMConstants.getCreateSequenceRefusedFaultCode());
+        sf.setFaultCode(constants.getCreateSequenceRefusedFaultCode());
         Message msg = new Message("CREATE_SEQ_REFUSED", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
         fault.setSequenceFault(sf);

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceIdentifierGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceIdentifierGenerator.java?rev=1137112&r1=1137111&r2=1137112&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceIdentifierGenerator.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceIdentifierGenerator.java Sat Jun 18 01:51:01 2011
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.ws.rm;
 
+import org.apache.cxf.ws.rm.v200702.Identifier;
+
 /**
  * 
  */



Mime
View raw message