You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2012/06/28 11:15:39 UTC

svn commit: r1354874 [2/14] - in /qpid/branches/java-config-and-management: ./ qpid/ qpid/bin/ qpid/cpp/ qpid/cpp/bindings/ qpid/cpp/bindings/qmf/ruby/ qpid/cpp/bindings/qpid/python/ qpid/cpp/bindings/qpid/ruby/ qpid/cpp/bindings/qpid/ruby/features/ qp...

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/python/python.i
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/python/python.i?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/python/python.i (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/python/python.i Thu Jun 28 09:14:52 2012
@@ -33,41 +33,68 @@
  * names as in the C++ library.  They get renamed to their Python
  * equivalents when brought into the Python wrapping
  */
+%define QPID_EXCEPTION(exception, parent)
 %{
-static PyObject* pNoMessageAvailable;
-static PyObject* pTargetCapacityExceeded;
-static PyObject* pNotFound;
-static PyObject* pTransportFailure;
+static PyObject* exception;
 %}
-
 %init %{
-    pNoMessageAvailable = PyErr_NewException(
-        "_cqpid.NoMessageAvailable", NULL, NULL);
-    Py_INCREF(pNoMessageAvailable);
-    PyModule_AddObject(m, "NoMessageAvailable", pNoMessageAvailable);
-
-    pTargetCapacityExceeded = PyErr_NewException(
-        "_cqpid.TargetCapacityExceeded", NULL, NULL);
-    Py_INCREF(pTargetCapacityExceeded);
-    PyModule_AddObject(m, "TargetCapacityExceeded", pTargetCapacityExceeded);
-
-    pNotFound = PyErr_NewException(
-        "_cqpid.NotFound", NULL, NULL);
-    Py_INCREF(pNotFound);
-    PyModule_AddObject(m, "NotFound", pNotFound);
-
-    pTransportFailure = PyErr_NewException(
-        "_cqpid.TransportFailure", NULL, NULL);
-    Py_INCREF(pTransportFailure);
-    PyModule_AddObject(m, "TransportFailure", pTransportFailure);
+    exception = PyErr_NewException(
+        (char *) ("_cqpid." #exception), parent, NULL);
+    Py_INCREF(exception);
+    PyModule_AddObject(m, #exception, exception);
 %}
-
 %pythoncode %{
-    Empty = _cqpid.NoMessageAvailable
-    TargetCapacityExceeded = _cqpid.TargetCapacityExceeded
-    NotFound = _cqpid.NotFound
-    ConnectError = _cqpid.TransportFailure
+    exception = _cqpid. ## exception
 %}
+%enddef
+
+ /* Python equivalents of C++ exceptions.                              */
+ /*                                                                    */
+ /* Commented out lines are exceptions in the Python library, but not  */
+ /* in the C++ library.                                                */
+
+QPID_EXCEPTION(MessagingError, NULL)
+
+QPID_EXCEPTION(LinkError, MessagingError)
+QPID_EXCEPTION(AddressError, LinkError)
+QPID_EXCEPTION(ResolutionError, AddressError)
+QPID_EXCEPTION(AssertionFailed, ResolutionError)
+QPID_EXCEPTION(NotFound, ResolutionError)
+QPID_EXCEPTION(InvalidOption, LinkError)
+QPID_EXCEPTION(MalformedAddress, LinkError)
+QPID_EXCEPTION(ReceiverError, LinkError)
+QPID_EXCEPTION(FetchError, ReceiverError)
+QPID_EXCEPTION(Empty, FetchError)
+/* QPID_EXCEPTION(InsufficientCapacity, LinkError) */
+/* QPID_EXCEPTION(LinkClosed, LinkError) */
+QPID_EXCEPTION(SenderError, LinkError)
+QPID_EXCEPTION(SendError, SenderError)
+QPID_EXCEPTION(TargetCapacityExceeded, SendError)
+
+QPID_EXCEPTION(ConnectionError, MessagingError)
+QPID_EXCEPTION(ConnectError, ConnectionError)
+/* QPID_EXCEPTION(AuthenticationFailure, ConnectError) */
+/* QPID_EXCEPTION(VersionError, ConnectError) */
+/* QPID_EXCEPTION(ConnectionClosed, ConnectionError) */
+/* QPID_EXCEPTION(HeartbeartTimeout, ConnectionError) */
+
+QPID_EXCEPTION(SessionError, MessagingError)
+/* QPID_EXCEPTION(Detached, SessionError) */
+/* QPID_EXCEPTION(NontransactionalSession, SessionError) */
+/* QPID_EXCEPTION(ServerError, SessionError) */
+/* QPID_EXCEPTION(SessionClosed, SessionError) */
+QPID_EXCEPTION(TransactionError, SessionError)
+QPID_EXCEPTION(TransactionAborted, TransactionError)
+QPID_EXCEPTION(UnauthorizedAccess, SessionError)
+
+/* QPID_EXCEPTION(InternalError, MessagingError) */
+
+%define TRANSLATE_EXCEPTION(cpp_exception, py_exception)
+    catch ( cpp_exception & ex) {
+        pExceptionType = py_exception;
+        error = ex.what();
+    }
+%enddef
 
 /* Define the general-purpose exception handling */
 %exception {
@@ -76,22 +103,31 @@ static PyObject* pTransportFailure;
     Py_BEGIN_ALLOW_THREADS;
     try {
         $action
-    } catch (qpid::messaging::NoMessageAvailable & ex) {
-        pExceptionType = pNoMessageAvailable;
-        error = ex.what();
-    } catch (qpid::messaging::TargetCapacityExceeded & ex) {
-        pExceptionType = pTargetCapacityExceeded;
-        error = ex.what();
-    } catch (qpid::messaging::NotFound & ex) {
-        pExceptionType = pNotFound;
-        error = ex.what();
-    } catch (qpid::messaging::TransportFailure & ex) {
-        pExceptionType = pTransportFailure;
-        error = ex.what();
-    } catch (qpid::types::Exception& ex) {
-        pExceptionType = PyExc_RuntimeError;
-        error = ex.what();
     }
+    /* Catch and translate exceptions. */
+    TRANSLATE_EXCEPTION(qpid::messaging::NoMessageAvailable, Empty)
+    TRANSLATE_EXCEPTION(qpid::messaging::NotFound, NotFound)
+    TRANSLATE_EXCEPTION(qpid::messaging::AssertionFailed, AssertionFailed)
+    TRANSLATE_EXCEPTION(qpid::messaging::ResolutionError, ResolutionError)
+    TRANSLATE_EXCEPTION(qpid::messaging::TargetCapacityExceeded,
+                        TargetCapacityExceeded)
+    TRANSLATE_EXCEPTION(qpid::messaging::TransportFailure, ConnectError)
+    TRANSLATE_EXCEPTION(qpid::messaging::MalformedAddress, MalformedAddress)
+    TRANSLATE_EXCEPTION(qpid::messaging::AddressError, AddressError)
+    TRANSLATE_EXCEPTION(qpid::messaging::FetchError, FetchError)
+    TRANSLATE_EXCEPTION(qpid::messaging::ReceiverError, ReceiverError)
+    TRANSLATE_EXCEPTION(qpid::messaging::SendError, SendError)
+    TRANSLATE_EXCEPTION(qpid::messaging::SenderError, SenderError)
+    TRANSLATE_EXCEPTION(qpid::messaging::InvalidOptionString, InvalidOption)
+    TRANSLATE_EXCEPTION(qpid::messaging::LinkError, LinkError)
+    TRANSLATE_EXCEPTION(qpid::messaging::TransactionAborted, TransactionAborted)
+    TRANSLATE_EXCEPTION(qpid::messaging::TransactionError, TransactionError)
+    TRANSLATE_EXCEPTION(qpid::messaging::UnauthorizedAccess, UnauthorizedAccess)
+    TRANSLATE_EXCEPTION(qpid::messaging::SessionError, SessionError)
+    TRANSLATE_EXCEPTION(qpid::messaging::ConnectionError, ConnectionError)
+    TRANSLATE_EXCEPTION(qpid::messaging::KeyError, PyExc_KeyError)
+    TRANSLATE_EXCEPTION(qpid::messaging::MessagingException, MessagingError)
+    TRANSLATE_EXCEPTION(qpid::types::Exception, PyExc_RuntimeError)
     Py_END_ALLOW_THREADS;
     if (!error.empty()) {
         PyErr_SetString(pExceptionType, error.c_str());
@@ -132,7 +168,10 @@ static PyObject* pTransportFailure;
          # equivalent in C++, so we will translate them to sasl_mechanism
          # when possible.
          def __init__(self, url=None, **options):
-             args = [url] if url else []
+             if url:
+                 args = [url]
+             else:
+                 args = []
              if options :
                  if "sasl_mechanisms" in options :
                      if ' ' in options.get("sasl_mechanisms",'') :
@@ -196,7 +235,7 @@ static PyObject* pTransportFailure;
                  self._acknowledge_all(sync)
 
          __swig_getmethods__["connection"] = getConnection
-         if _newclass: connection = _swig_property(getConnection)
+         if _newclass: connection = property(getConnection)
     %}
 }
 
@@ -205,10 +244,10 @@ static PyObject* pTransportFailure;
     %pythoncode %{
          __swig_getmethods__["capacity"] = getCapacity
          __swig_setmethods__["capacity"] = setCapacity
-         if _newclass: capacity = _swig_property(getCapacity, setCapacity)
+         if _newclass: capacity = property(getCapacity, setCapacity)
 
          __swig_getmethods__["session"] = getSession
-         if _newclass: session = _swig_property(getSession)
+         if _newclass: session = property(getSession)
     %}
 
     %pythoncode %{
@@ -233,10 +272,10 @@ static PyObject* pTransportFailure;
          
          __swig_getmethods__["capacity"] = getCapacity
          __swig_setmethods__["capacity"] = setCapacity
-         if _newclass: capacity = _swig_property(getCapacity, setCapacity)
+         if _newclass: capacity = property(getCapacity, setCapacity)
 
          __swig_getmethods__["session"] = getSession
-         if _newclass: session = _swig_property(getSession)
+         if _newclass: session = property(getSession)
     %}
 }
 
@@ -298,24 +337,23 @@ static PyObject* pTransportFailure;
                  self.setContent(content)
          __swig_getmethods__["content"] = _get_content
          __swig_setmethods__["content"] = _set_content
-         if _newclass: content = _swig_property(_get_content, _set_content)
+         if _newclass: content = property(_get_content, _set_content)
 
          __swig_getmethods__["content_type"] = getContentType
          __swig_setmethods__["content_type"] = setContentType
-         if _newclass: content_type = _swig_property(getContentType,
-                                                     setContentType)
+         if _newclass: content_type = property(getContentType, setContentType)
 
          __swig_getmethods__["id"] = getMessageId
          __swig_setmethods__["id"] = setMessageId
-         if _newclass: id = _swig_property(getMessageId, setMessageId)
+         if _newclass: id = property(getMessageId, setMessageId)
 
          __swig_getmethods__["subject"] = getSubject
          __swig_setmethods__["subject"] = setSubject
-         if _newclass: subject = _swig_property(getSubject, setSubject)
+         if _newclass: subject = property(getSubject, setSubject)
 
          __swig_getmethods__["priority"] = getPriority
          __swig_setmethods__["priority"] = setPriority
-         if _newclass: priority = _swig_property(getPriority, setPriority)
+         if _newclass: priority = property(getPriority, setPriority)
 
          def getTtl(self) :
              return self._getTtl().getMilliseconds()/1000.0
@@ -323,28 +361,26 @@ static PyObject* pTransportFailure;
              self._setTtl(Duration(int(1000*duration)))
          __swig_getmethods__["ttl"] = getTtl
          __swig_setmethods__["ttl"] = setTtl
-         if _newclass: ttl = _swig_property(getTtl, setTtl)
+         if _newclass: ttl = property(getTtl, setTtl)
 
          __swig_getmethods__["user_id"] = getUserId
          __swig_setmethods__["user_id"] = setUserId
-         if _newclass: user_id = _swig_property(getUserId, setUserId)
+         if _newclass: user_id = property(getUserId, setUserId)
 
          __swig_getmethods__["correlation_id"] = getCorrelationId
          __swig_setmethods__["correlation_id"] = setCorrelationId
-         if _newclass: correlation_id = _swig_property(getCorrelationId,
-                                                       setCorrelationId)
+         if _newclass: correlation_id = property(getCorrelationId, setCorrelationId)
 
          __swig_getmethods__["redelivered"] = getRedelivered
          __swig_setmethods__["redelivered"] = setRedelivered
-         if _newclass: redelivered = _swig_property(getRedelivered,
-                                                    setRedelivered)
+         if _newclass: redelivered = property(getRedelivered, setRedelivered)
 
          __swig_getmethods__["durable"] = getDurable
          __swig_setmethods__["durable"] = setDurable
-         if _newclass: durable = _swig_property(getDurable, setDurable)
+         if _newclass: durable = property(getDurable, setDurable)
 
          __swig_getmethods__["properties"] = getProperties
-         if _newclass: properties = _swig_property(getProperties)
+         if _newclass: properties = property(getProperties)
 
          def getReplyTo(self) :
              return self._getReplyTo().str()
@@ -352,7 +388,7 @@ static PyObject* pTransportFailure;
              self._setReplyTo(Address(address_str))
          __swig_getmethods__["reply_to"] = getReplyTo
          __swig_setmethods__["reply_to"] = setReplyTo
-         if _newclass: reply_to = _swig_property(getReplyTo, setReplyTo)
+         if _newclass: reply_to = property(getReplyTo, setReplyTo)
          
          def __repr__(self):
              args = []

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/LICENSE
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/LICENSE?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/LICENSE (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/LICENSE Thu Jun 28 09:14:52 2012
@@ -203,32 +203,3 @@
    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.
-
-=========================================================================
-==  Boost License                                                      ==
-=========================================================================
-
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/README.rdoc
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/README.rdoc?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/README.rdoc (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/README.rdoc Thu Jun 28 09:14:52 2012
@@ -2,7 +2,7 @@
 
 Qpid is an cross-platform enterprise messaging system.
 
-Version :: 0.10.0.alpha.0
+Version :: 0.17.0
 
 = Links
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/Rakefile
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/Rakefile?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/Rakefile (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/Rakefile Thu Jun 28 09:14:52 2012
@@ -120,7 +120,9 @@ spec = Gem::Specification.new do |s|
                                "lib/**/*.rb",
                                "test/**/*.rb",
                                "examples/**/*.rb",
-                               "ext/**/*"]
+                               "ext/**/*",
+                               "features/**/*",
+                               "spec/**/*"]
 end
 
 Gem::PackageTask.new(spec) do |pkg|

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature Thu Jun 28 09:14:52 2012
@@ -21,9 +21,9 @@ Feature: Creating a receiver
 
   Scenario: The address string is fine
     Given an open session
-    Then creating a receiver with "my-queue;{create:always}" succeeds
+    Then creating a receiver with "my-queue;{create:always,delete:always}" succeeds
 
   Scenario: Using an Address object
     Given an open session
-    And an Address with the name "create-receiver-test" and subject "foo" and option "create" set to "always"
+    And an Address with the name "create-receiver-test" and subject "foo" and option "create" set to "always" and "delete" set to "always"
     Then creating a receiver with an Address succeeds

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature Thu Jun 28 09:14:52 2012
@@ -5,11 +5,11 @@ Feature: Creating a sender
 
   Scenario: The session is closed
     Given a closed session
-    Then creating a sender with "my-queue;{create:always}" raises an exception
+    Then creating a sender with "my-queue;{create:always,delete:always}" raises an exception
 
   Scenario: The connection is closed
     Given an open session with a closed connection
-    Then creating a sender with "my-queue;{create:always}" raises an exception
+    Then creating a sender with "my-queue;{create:always,delete:always}" raises an exception
 
   Scenario: The address is malformed
     Given an open session
@@ -17,7 +17,7 @@ Feature: Creating a sender
 
   Scenario: The address string is valid
     Given an open session
-    Then creating a sender with "my-queue;{create:always}" succeeds
+    Then creating a sender with "my-queue;{create:always,delete:always}" succeeds
 
   Scenario: Using an Address object
     Given an open session

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature Thu Jun 28 09:14:52 2012
@@ -4,24 +4,26 @@ Feature: Receving a message
   I need to be able to receive messages
 
   Scenario: Receiving after the session is closed
-    Given a sender and receiver for "my-queue;{create:always}"
+    Given a sender and receiver for "my-queue;{create:always,delete:always}"
     And the message "this is a test" is sent
     And the session is closed
     Then getting the next message raises an error
 
   Scenario: Receiving after the connection is closed
-    Given a sender and receiver for "my-queue;{create:always}"
+    Given a sender and receiver for "my-queue;{create:always,delete:always}"
     And the message "this is a test" is sent
     And the connection is closed
     Then getting the next message raises an error
 
   Scenario: No message is received on an empty queue
-    Given an existing receiver for "my-queue;{create:always}"
+    Given an existing receiver for "my-queue;{create:always,delete:always}"
     And the receiver has no pending messages
     Then getting the next message raises an error
 
   Scenario: A message is pending
-    Given a sender and receiver for "my-queue;{create:always}"
+    Given an open session
+    And given a sender for "my-queue;{create:always}"
+    And given a receiver for "my-queue;{create:always,delete:always}"
     And the receiver has a capacity of 1
     And the message "this is a test" is sent
     Then the receiver should have 1 message available

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature Thu Jun 28 09:14:52 2012
@@ -5,17 +5,17 @@ Feature: Sending a message
 
   Scenario: The session is closed
     Given an open session
-    And creating a sender with "my-queue;{create:always}" succeeds
+    And creating a sender with "my-queue;{create:always,delete:always}" succeeds
     And the session is closed
     Then sending the message "This is a test" should raise an error
 
   Scenario: The connection is closed
     Given an open session
-    And creating a sender with "my-queue;{create:always}" succeeds
+    And creating a sender with "my-queue;{create:always,delete:always}" succeeds
     And the connection is closed
     Then sending the message "This is a test" should raise an error
 
   Scenario: The message sends successfully
     Given an open session
-    And creating a sender with "my-queue;{create:always}" succeeds
+    And creating a sender with "my-queue;{create:always,delete:always}" succeeds
     Then sending the message "This is a test" succeeds
\ No newline at end of file

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb Thu Jun 28 09:14:52 2012
@@ -1,5 +1,31 @@
+#
+# 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.
+#
+
 Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set to "([^"]*)"$/ do |name, subject, key, value|
   options = Hash.new
   options["#{key}"] = "#{value}"
   @address = Qpid::Messaging::Address.new "#{name}", "#{subject}", options
 end
+
+Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set to "([^"]*)" and "([^"]*)" set to "([^"]*)"$/ do |name, subject, key1, value1, key2, value2|
+  options = Hash.new
+  options["#{key1}"] = "#{value1}"
+  options["#{key2}"] = "#{value2}"
+  @address = Qpid::Messaging::Address.new "#{name}", "#{subject}", options
+end

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb Thu Jun 28 09:14:52 2012
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
 # close all connections
 After do
   @connection.close if @connection

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb Thu Jun 28 09:14:52 2012
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
 Given /^an existing receiver for "([^"]*)"$/ do |address|
   steps %Q{
     Given an open session
@@ -40,3 +59,11 @@ Then /^the receiver should have (\d+) me
   sleep 1
   @receiver.available.should == available.to_i
 end
+
+Given /^given a sender for "([^"]*)"$/ do |address|
+  @sender = @session.create_sender "#{address}"
+end
+
+Given /^given a receiver for "([^"]*)"$/ do |address|
+  @receiver = @session.create_receiver "#{address}"
+end

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb Thu Jun 28 09:14:52 2012
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
 Given /^the message "([^"]*)" is sent$/ do |content|
   @sender.send Qpid::Messaging::Message.new :content => "#{content}"
 end

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb Thu Jun 28 09:14:52 2012
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
 Given /^a closed session/ do
   steps %Q{
     Given an open connection

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb Thu Jun 28 09:14:52 2012
@@ -45,8 +45,10 @@ module Qpid
       content_type = message.content_type unless content_type
 
       case content_type
-        when "amqp/map":  Cqpid.decodeMap message.message_impl
-        when "amqp/list": Cqpid.decodeList message.message_impl
+        when "amqp/map"
+          Cqpid.decodeMap message.message_impl
+        when "amqp/list"
+          Cqpid.decodeList message.message_impl
       end
 
       message.content

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb Thu Jun 28 09:14:52 2012
@@ -22,7 +22,7 @@ module Qpid
   module Version
 
     NUMBERS = [MAJOR = 0,
-               MINOR = 13,
+               MINOR = 17,
                BUILD = 0]
   end
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/bindings/swig_python_typemaps.i
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/bindings/swig_python_typemaps.i?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/bindings/swig_python_typemaps.i (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/bindings/swig_python_typemaps.i Thu Jun 28 09:14:52 2012
@@ -25,7 +25,11 @@ static PyObject* pUuidModule;
 %}
 
 %init %{
-  pUuidModule = PyImport_ImportModule("uuid");
+  /* Instead of directly referencing the uuid module (which is not available
+   * on older versions of Python), reference the wrapper defined in
+   * qpid.datatypes.
+   */
+  pUuidModule = PyImport_ImportModule("qpid.datatypes");
 
   /* Although it is not required, we'll publish the uuid module in our
    * module, as if this module was a python module and we called

Modified: qpid/branches/java-config-and-management/qpid/cpp/configure.ac
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/configure.ac?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/configure.ac (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/configure.ac Thu Jun 28 09:14:52 2012
@@ -27,7 +27,7 @@ AC_PROG_CC_STDC
 AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_USE_SYSTEM_EXTENSIONS
-AC_LANG([C++])	
+AC_LANG([C++])
 
 # Check for optional use of help2man
 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
@@ -83,14 +83,14 @@ if test x$GXX = xyes; then
 	    gl_COMPILER_FLAGS(-Wvolatile-register-var)
 	    gl_COMPILER_FLAGS(-Winvalid-pch)
 	    gl_COMPILER_FLAGS(-Wno-system-headers)
-	    gl_COMPILER_FLAGS(-Woverloaded-virtual)	
+	    gl_COMPILER_FLAGS(-Woverloaded-virtual)
 	    AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
 	    AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
 	    COMPILER_FLAGS=
 	fi
 else
 	AC_CHECK_DECL([__SUNPRO_CC], [SUNCC=yes], [SUNCC=no])
-	
+
 	# Set up for sun CC compiler
 	if test x$SUNCC = xyes; then
 		if test "${enableval}" = yes; then
@@ -118,7 +118,7 @@ LIBS=$gl_saved_libs
 
 gl_CLOCK_TIME
 
-# Enable Valgrind	
+# Enable Valgrind
 AC_ARG_ENABLE([valgrind],
   [AS_HELP_STRING([--enable-valgrind],
     [run valgrind memory checker on tests, if available (default yes)])],
@@ -203,13 +203,26 @@ AM_CONDITIONAL([HAVE_RUBY_DEVEL], [test 
 # Python bindings: To build python wrappers, the python-devel files must be present.
 AM_PATH_PYTHON()
 AS_IF([test -n "$PYTHON"], [
-    PKG_CHECK_MODULES([PYTHON], [python], [have_python_dev=yes],[
+    PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_python_dev=yes],[
+    # We didn't find pkg-config information for python-2.7 this
+    # may mean we have an earlier python version:
+    # Try to find the include and library files directly in the default
+    # location
+    AC_MSG_WARN([Didn't find Python 2.7 developer libs - looking for older version])
+    PYTHON_INC=$($PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()')
+    AC_CHECK_LIB([python$PYTHON_VERSION],[Py_Initialize])
+    AC_CHECK_FILE(["$PYTHON_INC/Python.h"],[
+        PYTHON_CFLAGS="-I$PYTHON_INC"
+        PYTHON_LIBS="-lpython$PYTHON_VERSION"
+        have_python_dev=yes
+    ],[
         if test yes = "$with_python" ; then
             AC_MSG_ERROR([Couldn't find Python developer libs - you probably need to install a python-dev or python-devel package])
         else
             AC_MSG_WARN([Couldn't find Python developer libs - you probably don't have a python-dev or python-devel package installed])
         fi
     ])
+    ])
     AC_SUBST(PYTHON_CFLAGS)
     AC_SUBST(PYTHON_LIBS)
 ])
@@ -249,7 +262,7 @@ tmp_LDFLAGS=$LDFLAGS
 LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync"
 AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],)
 AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],)
-AC_ARG_WITH([cpg],  
+AC_ARG_WITH([cpg],
   [AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])],
   [case "${withval}" in
     yes)			# yes - require dependencies
@@ -257,7 +270,7 @@ AC_ARG_WITH([cpg],  
     test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or corosync-devel])
     with_cpg=yes
     ;;
-    no) with_cpg=no ;; 
+    no) with_cpg=no ;;
     *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;;
    esac],
    [		   # not specified - use if present
@@ -265,12 +278,14 @@ AC_ARG_WITH([cpg],  
    ]
 )
 AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_cpg = xyes])
+AC_SUBST(USE_CPG, [$with_cpg])
+
 # Clean up unnceccassary flags if we don't use clustering
 AS_IF([test ! x$with_cpg = xyes], [LDFLAGS=$tmp_LDFLAGS])
 
 AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,)
 AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,)
-AC_ARG_WITH([libcman],  
+AC_ARG_WITH([libcman],
   [AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])],
   [case "${withval}" in
     yes)			# yes - require dependencies
@@ -278,7 +293,7 @@ AC_ARG_WITH([libcman],  
     test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel or cmanlib-devel])
     with_libcman=yes
     ;;
-    no) with_libcman=no ;; 
+    no) with_libcman=no ;;
     *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;;
    esac],
    [				# not specified - use if present and we're using with_cpg
@@ -430,9 +445,9 @@ AC_ARG_WITH([ssl],
   [
     with_SSL=yes
     AC_PATH_PROG([NSPR_CONFIG], [nspr-config])
-    AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no], 
+    AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no],
       [AC_PATH_PROG([NSS_CONFIG], [nss-config])
-       AS_IF([test x$NSS_CONFIG = x], [with_SSL=no], 
+       AS_IF([test x$NSS_CONFIG = x], [with_SSL=no],
              [SSL_CFLAGS="`$NSPR_CONFIG --cflags` `$NSS_CONFIG --cflags`"
               SSL_LDFLAGS="`$NSPR_CONFIG --libs` `$NSS_CONFIG --libs`"])])
   ]
@@ -502,11 +517,11 @@ AC_ARG_WITH([probes],
 )
 
 # Check for some syslog capabilities not present in all systems
-AC_TRY_COMPILE([#include <sys/syslog.h>], 
+AC_TRY_COMPILE([#include <sys/syslog.h>],
                [int v = LOG_AUTHPRIV;],
                [AC_DEFINE([HAVE_LOG_AUTHPRIV], [1], [Set to 1 whether LOG_AUTHPRIV is supported.])],)
 
-AC_TRY_COMPILE([#include <sys/syslog.h>], 
+AC_TRY_COMPILE([#include <sys/syslog.h>],
                [int v = LOG_FTP;],
                [AC_DEFINE([HAVE_LOG_FTP], [1], [Set to 1 whether LOG_FTP is supported.])],)
 
@@ -524,8 +539,6 @@ AC_CHECK_LIB([nsl],[getipnodebyname],[NS
 SOCKLIBS="$SOCKET_LIB $NSL_LIB"
 AC_SUBST([SOCKLIBS])
 
-AM_PATH_PYTHON()
-
 # Used by env scripts to find libraries in cmake or autoconf builds.
 builddir_lib_suffix="/.libs"
 AC_SUBST([builddir_lib_suffix])
@@ -560,6 +573,7 @@ AC_CONFIG_FILES([
   managementgen/Makefile
   etc/Makefile
   src/Makefile
+  src/tests/cpg_check.sh
   src/tests/Makefile
   src/tests/test_env.sh
   src/tests/install_env.sh

Propchange: qpid/branches/java-config-and-management/qpid/cpp/docs/api/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/docs/api:r1300143-1349442,1349444-1349530,1349532-1353860

Modified: qpid/branches/java-config-and-management/qpid/cpp/etc/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/etc/Makefile.am?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/etc/Makefile.am (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/etc/Makefile.am Thu Jun 28 09:14:52 2012
@@ -20,9 +20,10 @@ SASL_CONF = sasl2/qpidd.conf
 
 EXTRA_DIST = \
 	$(SASL_CONF) \
-	qpidd qpidd-primary qpidd.conf qpidc.conf CMakeLists.txt
+	qpidd.in qpidd-primary.in qpidd.conf qpidc.conf CMakeLists.txt \
+	cluster.conf-example.xml.in
 
-confdir=$(sysconfdir)/qpid
+confdir = $(sysconfdir)/qpid
 nobase_conf_DATA=\
 	qpidc.conf
 
@@ -32,5 +33,23 @@ nobase_sysconf_DATA = \
 if HAVE_SASL
 nobase_sysconf_DATA += \
 	$(SASL_CONF)
-
 endif
+
+# Substitute values for directories in init scripts.
+#
+# We can't use autoconf substitution directly because it leaves
+#  ${prefix} and ${exec_prefix} unexpanded. Substitute with sed
+#  scripts.
+SUBST="s|!!sysconfdir!!|${sysconfdir}|;s|!!sbindir!!|${sbindir}|;s|!!bindir!!|${bindir}|"
+qpidd: qpidd.in
+	sed $(SUBST) $< > $@
+qpidd-primary: qpidd-primary.in
+	sed $(SUBST) $< > $@
+cluster.conf-example.xml: cluster.conf-example.xml.in
+	sed $(SUBST) $< > $@
+
+CLEANFILES = qpidd qpidd-primary cluster.conf-example.xml
+
+initddir = $(sysconfdir)/init.d
+nobase_initd_SCRIPTS = qpidd qpidd-primary
+

Copied: qpid/branches/java-config-and-management/qpid/cpp/etc/cluster.conf-example.xml.in (from r1309633, qpid/trunk/qpid/cpp/etc/cluster.conf-example.xml.in)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/etc/cluster.conf-example.xml.in?p2=qpid/branches/java-config-and-management/qpid/cpp/etc/cluster.conf-example.xml.in&p1=qpid/trunk/qpid/cpp/etc/cluster.conf-example.xml.in&r1=1309633&r2=1354874&rev=1354874&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/etc/cluster.conf-example.xml.in (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/etc/cluster.conf-example.xml.in Thu Jun 28 09:14:52 2012
@@ -2,36 +2,33 @@
 <!--
 This is an example of a cluster.conf file to run qpidd HA under rgmanager.
 This example assumes a 3 node cluster, with nodes named node1, node2 and node3.
+
+NOTE: fencing is not shown, it should be configured in a real cluster configuration.
 -->
 
 <cluster name="qpid-test" config_version="18">
-  <!-- The cluster has 3 nodes. Each has a unique nodid and one vote for quorum. -->
+  <!-- The cluster has 3 nodes. Each has a unique nodid and one vote
+       for quorum. -->
   <clusternodes>
-    <clusternode name="node1" nodeid="1">
-      <fence/>
-    </clusternode>
-    <clusternode name="node2" nodeid="2">
-      <fence/>
-    </clusternode>
-    <clusternode name="node3" nodeid="3">
-      <fence/>
-    </clusternode>
+    <clusternode name="node1.example.com" nodeid="1"/>
+    <clusternode name="node2.example.com" nodeid="2"/>
+    <clusternode name="node3.example.com" nodeid="3"/>
   </clusternodes>
   <!-- Resouce Manager configuration. -->
-  <rm log_level="7">		<!-- Verbose logging -->
+  <rm>
     <!--
 	There is a failoverdomain for each node containing just that node.
-	This lets us stipulate that the qpidd service should always run on all nodes.
+	This lets us stipulate that the qpidd service should always run on each node.
     -->
     <failoverdomains>
       <failoverdomain name="node1-domain" restricted="1">
-	<failoverdomainnode name="node1"/>
+	<failoverdomainnode name="node1.example.com"/>
       </failoverdomain>
       <failoverdomain name="node2-domain" restricted="1">
-	<failoverdomainnode name="node2"/>
+	<failoverdomainnode name="node2.example.com"/>
       </failoverdomain>
       <failoverdomain name="node3-domain" restricted="1">
-	<failoverdomainnode name="node3"/>
+	<failoverdomainnode name="node3.example.com"/>
       </failoverdomain>
     </failoverdomains>
 

Copied: qpid/branches/java-config-and-management/qpid/cpp/etc/qpidd.in (from r1309633, qpid/trunk/qpid/cpp/etc/qpidd.in)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/etc/qpidd.in?p2=qpid/branches/java-config-and-management/qpid/cpp/etc/qpidd.in&p1=qpid/trunk/qpid/cpp/etc/qpidd.in&r1=1309633&r2=1354874&rev=1354874&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/etc/qpidd.in (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/etc/qpidd.in Thu Jun 28 09:14:52 2012
@@ -39,13 +39,14 @@ prog=qpidd
 lockfile=/var/lock/subsys/$prog
 pidfile=/var/run/qpidd.pid
 
-# Source function library.
-. /etc/rc.d/init.d/functions
-
+# Source configuration
 if [ -f !!sysconfdir!!/sysconfig/$prog ] ; then
 	. !!sysconfdir!!/sysconfig/$prog
 fi
 
+# Source function library.
+. /etc/rc.d/init.d/functions
+
 RETVAL=0
 
 #ensure binary is present and executable

Propchange: qpid/branches/java-config-and-management/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj:r1300143-1349442,1349444-1349530,1349532-1353860

Propchange: qpid/branches/java-config-and-management/qpid/cpp/include/qmf/engine/Agent.h
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/include/qmf/engine/Agent.h:r1300143-1349442,1349444-1349530,1349532-1353860

Propchange: qpid/branches/java-config-and-management/qpid/cpp/include/qmf/engine/Console.h
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/include/qmf/engine/Console.h:r1300143-1349442,1349444-1349530,1349532-1353860

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Options.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Options.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Options.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Options.h Thu Jun 28 09:14:52 2012
@@ -81,13 +81,12 @@ po::value_semantic* optValue(T& value, c
  */
 template <class T>
 po::value_semantic* optValue(std::vector<T>& value, const char* name) {
-    using namespace std;
-    ostringstream os;
-    copy(value.begin(), value.end(), ostream_iterator<T>(os, " "));
-    string val=os.str();
+    std::ostringstream os;
+    std::copy(value.begin(), value.end(), std::ostream_iterator<T>(os, " "));
+    std::string val=os.str();
     if (!val.empty())
         val.erase(val.end()-1); // Remove trailing " "
-    return (new OptionValue<vector<T> >(value, prettyArg(name, val)));
+    return (new OptionValue<std::vector<T> >(value, prettyArg(name, val)));
 }
 
 /** Create a boolean switch value. Presence of the option sets the value. */
@@ -163,10 +162,12 @@ struct Options : public po::options_desc
  */
 struct CommonOptions : public Options {
     QPID_COMMON_EXTERN CommonOptions(const std::string& name=std::string(),
-                  const std::string& configfile=std::string());
+                                     const std::string& configfile=std::string(),
+                                     const std::string& clientConfigFile=std::string());
     bool help;
     bool version;
     std::string config;
+    std::string clientConfig;
 };
 
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/RangeSet.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/RangeSet.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/RangeSet.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/RangeSet.h Thu Jun 28 09:14:52 2012
@@ -224,17 +224,15 @@ bool RangeSet<T>::contains(const Range<T
 
 template <class T> void RangeSet<T>::addRange(const Range<T>& r) {
     if (r.empty()) return;
-    typename Ranges::iterator i =
-        std::lower_bound(ranges.begin(), ranges.end(), r);
+    typename Ranges::iterator i = std::lower_bound(ranges.begin(), ranges.end(), r);
     if (i == ranges.end() || !i->touching(r))
-        ranges.insert(i, r);
+        ranges.insert(i, r);    // No overlap
     else {
         i->merge(r);
         typename Ranges::iterator j = i;
-        if (++j != ranges.end() && i->touching(*j)) {
+        while (++j != ranges.end() && i->touching(*j))
             i->merge(*j);
-            ranges.erase(j);
-        }
+        ranges.erase(i+1,j);
     }
 }
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Url.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Url.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Url.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/Url.h Thu Jun 28 09:14:52 2012
@@ -39,7 +39,7 @@ struct Url : public std::vector<Address>
      * on a multi-homed host. */
     QPID_COMMON_EXTERN static Url getIpAddressesUrl(uint16_t port);
 
-    struct Invalid : public Exception { Invalid(const std::string& s); };
+    struct Invalid : public Exception { QPID_COMMON_EXTERN Invalid(const std::string& s); };
 
     /** Convert to string form. */
     QPID_COMMON_EXTERN std::string str() const;

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SessionBase_0_10.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SessionBase_0_10.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SessionBase_0_10.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SessionBase_0_10.h Thu Jun 28 09:14:52 2012
@@ -36,14 +36,13 @@ namespace client {
 class Connection;
 class SessionImpl;
 
-using std::string;
-using framing::Content;
-using framing::FieldTable;
-using framing::SequenceNumber;
-using framing::SequenceSet;
-using framing::SequenceNumberSet;
+using qpid::framing::Content;
+using qpid::framing::FieldTable;
+using qpid::framing::SequenceNumber;
+using qpid::framing::SequenceSet;
+using qpid::framing::SequenceNumberSet;
 using qpid::SessionId;
-using framing::Xid;
+using qpid::framing::Xid;
 
 /** Unit of message credit: messages or bytes */
 enum CreditUnit { MESSAGE_CREDIT=0, BYTE_CREDIT=1, UNLIMITED_CREDIT=0xFFFFFFFF };

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SubscriptionSettings.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SubscriptionSettings.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SubscriptionSettings.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/client/SubscriptionSettings.h Thu Jun 28 09:14:52 2012
@@ -28,7 +28,19 @@ namespace qpid {
 namespace client {
 
 /** Bring AMQP enum definitions for message class into this namespace. */
-using namespace qpid::framing::message;
+using qpid::framing::message::AcceptMode;
+using qpid::framing::message::AcquireMode;
+using qpid::framing::message::ACCEPT_MODE_EXPLICIT;
+using qpid::framing::message::ACCEPT_MODE_NONE;
+using qpid::framing::message::ACQUIRE_MODE_NOT_ACQUIRED;
+using qpid::framing::message::ACQUIRE_MODE_PRE_ACQUIRED;
+using qpid::framing::message::CREDIT_UNIT_BYTE;
+using qpid::framing::message::CREDIT_UNIT_MESSAGE;
+using qpid::framing::message::DELIVERY_MODE_NON_PERSISTENT;
+using qpid::framing::message::DELIVERY_MODE_PERSISTENT;
+using qpid::framing::message::FLOW_MODE_CREDIT;
+using qpid::framing::message::FLOW_MODE_WINDOW;
+
 
 enum CompletionMode {
     MANUAL_COMPLETION = 0,

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Array.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Array.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Array.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Array.h Thu Jun 28 09:14:52 2012
@@ -1,3 +1,6 @@
+#ifndef QPID_FRAMING_ARRAY_H
+#define QPID_FRAMING_ARRAY_H
+
 /*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -18,21 +21,22 @@
  * under the License.
  *
  */
+
 #include "qpid/framing/amqp_types.h"
-#include "qpid/framing/FieldValue.h"
 #include "qpid/framing/TypeCode.h"
+
 #include <boost/shared_ptr.hpp>
+
 #include <iostream>
 #include <vector>
-#include "qpid/CommonImportExport.h"
 
-#ifndef _Array_
-#define _Array_
+#include "qpid/CommonImportExport.h"
 
 namespace qpid {
 namespace framing {
 
 class Buffer;
+class FieldValue;
 
 class QPID_COMMON_CLASS_EXTERN Array
 {
@@ -75,12 +79,10 @@ class QPID_COMMON_CLASS_EXTERN Array
     // Non-std interface
     QPID_COMMON_INLINE_EXTERN void add(ValuePtr value) { push_back(value); }
 
-    template <class T>
-    void collect(std::vector<T>& out) const
-    {
-        for (ValueVector::const_iterator i = values.begin(); i != values.end(); ++i) {
-            out.push_back((*i)->get<T>());
-        }
+    // For use in standard algorithms
+    template <typename R, typename V>
+    static R get(const V& v) {
+        return v->template get<R>();
     }
 
   private:

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Buffer.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Buffer.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Buffer.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Buffer.h Thu Jun 28 09:14:52 2012
@@ -1,3 +1,6 @@
+#ifndef QPID_FRAMING_BUFFER_H
+#define QPID_FRAMING_BUFFER_H
+
 /*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -18,13 +21,12 @@
  * under the License.
  *
  */
-#include "qpid/framing/amqp_types.h"
+
 #include "qpid/Exception.h"
 #include "qpid/CommonImportExport.h"
-#include <boost/iterator/iterator_facade.hpp>
+#include "qpid/sys/IntegerTypes.h"
 
-#ifndef _Buffer_
-#define _Buffer_
+#include <string>
 
 namespace qpid {
 namespace framing {
@@ -41,42 +43,18 @@ class QPID_COMMON_CLASS_EXTERN Buffer
     uint32_t size;
     char* data;
     uint32_t position;
-    uint32_t r_position;
 
   public:
     void checkAvailable(uint32_t count) { if (position + count > size) throw OutOfBounds(); }
 
-    /** Buffer input/output iterator.
-     * Supports using an amqp_0_10::Codec with a framing::Buffer.
-     */
-    class Iterator  : public boost::iterator_facade<
-      Iterator, char, boost::random_access_traversal_tag>
-    {
-      public:
-        Iterator(Buffer& b) : buffer(&b) {}
-
-      private:
-      friend class boost::iterator_core_access;
-        char& dereference() const { return buffer->data[buffer->position]; }
-        void increment() { ++buffer->position; }
-        bool equal(const Iterator& x) const { return buffer == x.buffer; }
-
-        Buffer* buffer;
-    };
-
-  friend class Iterator;
-
     QPID_COMMON_EXTERN Buffer(char* data=0, uint32_t size=0);
 
-    QPID_COMMON_EXTERN void record();
-    QPID_COMMON_EXTERN void restore(bool reRecord = false);
     QPID_COMMON_EXTERN void reset();
 
     QPID_COMMON_INLINE_EXTERN uint32_t available() { return size - position; }
     QPID_COMMON_INLINE_EXTERN uint32_t getSize() { return size; }
     QPID_COMMON_INLINE_EXTERN uint32_t getPosition() { return position; }
     QPID_COMMON_INLINE_EXTERN void setPosition(uint32_t p) { position = p; }
-    QPID_COMMON_INLINE_EXTERN Iterator getIterator() { return Iterator(*this); }
     QPID_COMMON_INLINE_EXTERN char* getPointer() { return data; }
 
     QPID_COMMON_EXTERN void putOctet(uint8_t i);
@@ -108,16 +86,16 @@ class QPID_COMMON_CLASS_EXTERN Buffer
     template <int n>
     QPID_COMMON_EXTERN void putUInt(uint64_t);
 
-    QPID_COMMON_EXTERN void putShortString(const string& s);
-    QPID_COMMON_EXTERN void putMediumString(const string& s);
-    QPID_COMMON_EXTERN void putLongString(const string& s);
-    QPID_COMMON_EXTERN void getShortString(string& s);
-    QPID_COMMON_EXTERN void getMediumString(string& s);
-    QPID_COMMON_EXTERN void getLongString(string& s);
+    QPID_COMMON_EXTERN void putShortString(const std::string& s);
+    QPID_COMMON_EXTERN void putMediumString(const std::string& s);
+    QPID_COMMON_EXTERN void putLongString(const std::string& s);
+    QPID_COMMON_EXTERN void getShortString(std::string& s);
+    QPID_COMMON_EXTERN void getMediumString(std::string& s);
+    QPID_COMMON_EXTERN void getLongString(std::string& s);
     QPID_COMMON_EXTERN void getBin128(uint8_t* b);
 
-    QPID_COMMON_EXTERN void putRawData(const string& s);
-    QPID_COMMON_EXTERN void getRawData(string& s, uint32_t size);
+    QPID_COMMON_EXTERN void putRawData(const std::string& s);
+    QPID_COMMON_EXTERN void getRawData(std::string& s, uint32_t size);
 
     QPID_COMMON_EXTERN void putRawData(const uint8_t* data, size_t size);
     QPID_COMMON_EXTERN void getRawData(uint8_t* data, size_t size);

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/FieldTable.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/FieldTable.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/FieldTable.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/FieldTable.h Thu Jun 28 09:14:52 2012
@@ -1,3 +1,6 @@
+#ifndef _FieldTable_
+#define _FieldTable_
+
 /*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -18,16 +21,17 @@
  * under the License.
  *
  */
-#include <iostream>
-#include <vector>
+
+#include "qpid/framing/amqp_types.h"
+#include "qpid/sys/Mutex.h"
+
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_array.hpp>
+
+#include <iosfwd>
 #include <map>
-#include "qpid/framing/amqp_types.h"
-#include "qpid/CommonImportExport.h"
 
-#ifndef _FieldTable_
-#define _FieldTable_
+#include "qpid/CommonImportExport.h"
 
 namespace qpid {
     /**
@@ -114,11 +118,13 @@ class FieldTable
 
   private:
     void realDecode() const;
-    void flushRawCache() const;
+    void flushRawCache();
 
+    mutable qpid::sys::Mutex lock;
     mutable ValueMap values;
     mutable boost::shared_array<uint8_t> cachedBytes;
     mutable uint32_t cachedSize; // if = 0 then non cached size as 0 is not a legal size
+    mutable bool newBytes;
 
     QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream& out, const FieldTable& body);
 };

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/ProtocolVersion.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/ProtocolVersion.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/ProtocolVersion.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/ProtocolVersion.h Thu Jun 28 09:14:52 2012
@@ -24,6 +24,8 @@
 #include "qpid/framing/amqp_types.h"
 #include "qpid/CommonImportExport.h"
 
+#include <string>
+
 namespace qpid
 {
 namespace framing

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/SequenceNumber.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/SequenceNumber.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/SequenceNumber.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/SequenceNumber.h Thu Jun 28 09:14:52 2012
@@ -57,12 +57,18 @@ boost::equality_comparable<
     QPID_COMMON_EXTERN uint32_t encodedSize() const;
 
     template <class S> void serialize(S& s) { s(value); }
-
-  friend inline int32_t operator-(const SequenceNumber& a, const SequenceNumber& b);
 };
 
 inline int32_t operator-(const SequenceNumber& a, const SequenceNumber& b) {
-    return int32_t(a.value - b.value);
+    return int32_t(a.getValue() - b.getValue());
+}
+
+inline SequenceNumber operator+(const SequenceNumber& a, int32_t n) {
+    return SequenceNumber(a.getValue() + n);
+}
+
+inline SequenceNumber operator-(const SequenceNumber& a, int32_t n) {
+    return SequenceNumber(a.getValue() - n);
 }
 
 struct Window

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/StructHelper.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/StructHelper.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/StructHelper.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/StructHelper.h Thu Jun 28 09:14:52 2012
@@ -34,7 +34,7 @@ class QPID_COMMON_CLASS_EXTERN StructHel
 {
 public:
 
-    template <class T> void encode(const T t, std::string& data) {
+    template <class T> void encode(const T& t, std::string& data) {
         uint32_t size = t.bodySize() + 2/*type*/;
         data.resize(size);
         Buffer wbuffer(const_cast<char*>(data.data()), size);

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Uuid.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Uuid.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Uuid.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/Uuid.h Thu Jun 28 09:14:52 2012
@@ -48,6 +48,9 @@ struct Uuid : public boost::array<uint8_
     /** Copy from 16 bytes of data. */
     QPID_COMMON_EXTERN Uuid(const uint8_t* data);
 
+    /** Parse format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */
+    QPID_COMMON_EXTERN Uuid(const std::string&);
+
     // Default op= and copy ctor are fine.
     // boost::array gives us ==, < etc.
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/amqp_types.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/amqp_types.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/amqp_types.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/framing/amqp_types.h Thu Jun 28 09:14:52 2012
@@ -27,12 +27,10 @@
  */
 
 #include "qpid/sys/IntegerTypes.h"
-#include <string>
 
 namespace qpid {
 namespace framing {
 
-using std::string;
 typedef uint8_t FrameType;
 typedef uint16_t ChannelId;
 typedef uint32_t BatchOffset;

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Logger.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Logger.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Logger.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Logger.h Thu Jun 28 09:14:52 2012
@@ -36,7 +36,7 @@ namespace log {
 class QPID_COMMON_CLASS_EXTERN Logger : private boost::noncopyable {
   public:
     /** Flags indicating what to include in the log output */
-    enum FormatFlag { FILE=1, LINE=2, FUNCTION=4, LEVEL=8, TIME=16, THREAD=32, HIRES=64};
+    enum FormatFlag { FILE=1, LINE=2, FUNCTION=4, LEVEL=8, TIME=16, THREAD=32, HIRES=64, CATEGORY=128};
 
     /**
      * Logging output sink.

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Options.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Options.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Options.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Options.h Thu Jun 28 09:14:52 2012
@@ -39,7 +39,7 @@ struct Options : public qpid::Options {
     std::string argv0;
     std::string name;
     std::vector<std::string> selectors;
-    bool time, level, thread, source, function, hiresTs;
+    bool time, level, thread, source, function, hiresTs, category;
     bool trace;
     std::string prefix;
     std::auto_ptr<SinkOptions> sinkOptions;

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Selector.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Selector.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Selector.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Selector.h Thu Jun 28 09:14:52 2012
@@ -35,17 +35,24 @@ struct Options;
 class Selector {
   public:
     /** Empty selector selects nothing */
-    Selector() {}
+    Selector() {
+        reset();
+    }
 
     /** Set selector from Options */
     QPID_COMMON_EXTERN Selector(const Options&);
 
     /** Equavlient to: Selector s; s.enable(l, s) */
     Selector(Level l, const std::string& s=std::string()) {
+        reset();
         enable(l,s);
     }
 
-    Selector(const std::string& enableStr) { enable(enableStr); }
+    Selector(const std::string& enableStr) {
+        reset();
+        enable(enableStr);
+    }
+
     /**
      * Enable messages with level in levels where the file
      * name contains substring. Empty string matches all.
@@ -54,14 +61,30 @@ class Selector {
         substrings[level].push_back(substring);
     }
 
+    /**
+     * Enable messages at this level for this category
+     */
+    void enable(Level level, Category category) {
+        catFlags[level][category] = true;
+    }
+
     /** Enable based on a 'level[+]:file' string */
     QPID_COMMON_EXTERN void enable(const std::string& enableStr);
 
     /** True if level is enabled for file. */
     QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function);
+    QPID_COMMON_EXTERN bool isEnabled(Level level, const char* function, Category category);
+
+    /** Reset the category enable flags */
+    QPID_COMMON_EXTERN void reset() {
+        for (int lt = 0; lt < LevelTraits::COUNT; ++lt)
+            for (int ct = 0; ct < CategoryTraits::COUNT; ++ct)
+                catFlags[lt][ct] = false;
+    }
 
   private:
     std::vector<std::string> substrings[LevelTraits::COUNT];
+    bool catFlags[LevelTraits::COUNT][CategoryTraits::COUNT];
 };
 
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Statement.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Statement.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Statement.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/log/Statement.h Thu Jun 28 09:14:52 2012
@@ -22,6 +22,7 @@
 #include "qpid/Msg.h"
 #include "qpid/CommonImportExport.h"
 #include <boost/current_function.hpp>
+#include <list>
 
 namespace qpid {
 namespace log {
@@ -55,15 +56,118 @@ struct LevelTraits {
     static const char* name(Level);
 };
 
-/** POD struct representing a logging statement in source code. */
+/** Formal message categories
+ * https://issues.apache.org/jira/browse/QPID-3902
+ *
+ * Category    Source code directory
+ * --------    ---------------------
+ * Security    acl ssl gssapi sasl cyrus
+ * Broker      broker
+ * Management  agent console qmf
+ * Protocol    amqp_0_10 framing
+ * System      log sys types xml thread mutex fork pipe time ...
+ * HA          cluster ha replication
+ * Messaging   messaging
+ * Client      client
+ * Store       store
+ * Network     tcp rdma AsynchIO socket epoll
+ * Test
+ * Unspecified
+ */
+enum Category { security, broker, management, protocol, system, ha, messaging,
+    store, network, test, client, unspecified };
+struct CategoryTraits {
+    static const int COUNT=unspecified+1;
+
+    /** Test if given name is a Category name
+     */
+    static bool isCategory(const std::string& name);
+
+    /** Get category from string name
+     * @exception if name invalid.
+     */
+    static Category category(const char* name);
+
+    /** Get category from string name.
+     * @exception if name invalid.
+     */
+    static  Category category(const std::string& name) {
+        return category(name.c_str());
+    }
+
+    /** String name of category */
+    static const char* name(Category);
+};
+
+
+class CategoryFileNameHints {
+public:
+    CategoryFileNameHints(){
+        hintList.push_back(std::make_pair("AsynchIo",    network));
+        hintList.push_back(std::make_pair("TCP",         network));
+        hintList.push_back(std::make_pair("epoll",       network));
+        hintList.push_back(std::make_pair("Pollable",    network));
+        hintList.push_back(std::make_pair("Socket",      network));
+
+        hintList.push_back(std::make_pair("Sasl",        security));
+        hintList.push_back(std::make_pair("Ssl",         security));
+        hintList.push_back(std::make_pair("Acl",         security));
+        hintList.push_back(std::make_pair("acl",         security));
+        hintList.push_back(std::make_pair("cyrus",       security));
+
+        hintList.push_back(std::make_pair("amqp_",       protocol));
+        hintList.push_back(std::make_pair("framing",     protocol));
+
+        hintList.push_back(std::make_pair("management",  management));
+        hintList.push_back(std::make_pair("qmf",         management));
+        hintList.push_back(std::make_pair("console",     management));
+        hintList.push_back(std::make_pair("Management",  management));
+
+        hintList.push_back(std::make_pair("cluster",     ha));
+        hintList.push_back(std::make_pair("qpid/ha",     ha));
+        hintList.push_back(std::make_pair("qpid\\ha",    ha));
+        hintList.push_back(std::make_pair("replication", ha));
+        hintList.push_back(std::make_pair("ClusterSafe", ha));
+
+        hintList.push_back(std::make_pair("broker",      broker));
+        hintList.push_back(std::make_pair("SessionState",broker));
+        hintList.push_back(std::make_pair("DataDir",     broker));
+        hintList.push_back(std::make_pair("qpidd",       broker));
+        hintList.push_back(std::make_pair("xml",         broker));
+        hintList.push_back(std::make_pair("QpidBroker",  broker));
+
+        hintList.push_back(std::make_pair("store",       store));
+
+        hintList.push_back(std::make_pair("assert",      system));
+        hintList.push_back(std::make_pair("Exception",   system));
+        hintList.push_back(std::make_pair("sys",         system));
+        hintList.push_back(std::make_pair("SCM",         system));
+
+        hintList.push_back(std::make_pair("tests",       test));
+
+        hintList.push_back(std::make_pair("messaging",   messaging));
+        hintList.push_back(std::make_pair("types",       messaging));
+
+        hintList.push_back(std::make_pair("client",      client));
+    }
+
+    static Category categoryOf(const char*const fName);
+
+private:
+    std::list<std::pair<const char* const, Category> > hintList;
+};
+
+ /** POD struct representing a logging statement in source code. */
 struct Statement {
     bool enabled;
     const char* file;
     int line;
     const char* function;
     Level level;
+    Category category;
 
     QPID_COMMON_EXTERN void log(const std::string& message);
+    QPID_COMMON_EXTERN static void categorize(Statement& s);
 
     struct Initializer {
         QPID_COMMON_EXTERN Initializer(Statement& s);
@@ -72,8 +176,14 @@ struct Statement {
 };
 
 ///@internal static initializer for a Statement.
-#define QPID_LOG_STATEMENT_INIT(level) \
-    { 0, __FILE__, __LINE__,  BOOST_CURRENT_FUNCTION, (::qpid::log::level) }
+#define QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY) \
+{ 0, __FILE__, __LINE__,  BOOST_CURRENT_FUNCTION, (::qpid::log::LEVEL), \
+(::qpid::log::CATEGORY) }
+
+
+///@internal static initializer for a Statement with unspecified category
+#define QPID_LOG_STATEMENT_INIT(LEVEL) \
+QPID_LOG_STATEMENT_INIT_CAT ( LEVEL , unspecified )
 
 /**
  * Like QPID_LOG but computes an additional boolean test expression
@@ -96,13 +206,26 @@ struct Statement {
     } while(0)
 
 /**
+ * Line QPID_LOG_IF but with the additional specification of a category.
+ * @param CATEGORY message category.
+ */
+#define QPID_LOG_IF_CAT(LEVEL, CATEGORY, TEST, MESSAGE)         \
+    do {                                                        \
+        using ::qpid::log::Statement;                           \
+        static Statement stmt_= QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY); \
+        static Statement::Initializer init_(stmt_);             \
+        if (stmt_.enabled && (TEST))                            \
+            stmt_.log(::qpid::Msg() << MESSAGE);                \
+    } while(0)
+
+/**
  * FLAG must be a boolean variable. Assigns FLAG to true iff logging
  * is enabled for LEVEL in the calling context.  Use when extra
  * support code is needed to generate log messages, to ensure that it
  * is only run if the logging level is enabled.
  * e.g.
  * bool logWarning;
- * QPID_LOG_TEST(LEVEL, logWarning);
+ * QPID_LOG_TEST(warning, logWarning);
  * if (logWarning) { do stuff needed for warning log messages }
  */
 #define QPID_LOG_TEST(LEVEL, FLAG)                              \
@@ -113,12 +236,31 @@ struct Statement {
         FLAG = stmt_.enabled;                                   \
     } while(0)
 
+    /**
+     * FLAG must be a boolean variable. Assigns FLAG to true iff logging
+     * is enabled for LEVEL in the calling context.  Use when extra
+     * support code is needed to generate log messages, to ensure that it
+     * is only run if the logging level is enabled.
+     * e.g.
+     * bool logWarning;
+     * QPID_LOG_TEST_CAT(warning, System, logWarning);
+     * if (logWarning) { do stuff needed for warning log messages }
+     */
+    #define QPID_LOG_TEST_CAT(LEVEL, CATEGORY, FLAG)                \
+    do {                                                        \
+        using ::qpid::log::Statement;                           \
+        static Statement stmt_= QPID_LOG_STATEMENT_INIT_CAT(LEVEL, CATEGORY); \
+        static Statement::Initializer init_(stmt_);             \
+        FLAG = stmt_.enabled;                                   \
+    } while(0)
+
 /**
  * Macro for log statements. Example of use:
  * @code
  * QPID_LOG(debug, "There are " << foocount << " foos in the bar.");
  * QPID_LOG(error, boost::format("Dohickey %s exploded") % dohicky.name());
  * @endcode
+ * Using QPID_LOG implies a category of Unspecified.
  *
  * You can subscribe to log messages by level, by component, by filename
  * or a combination @see Configuration.
@@ -130,6 +272,25 @@ struct Statement {
  */
 #define QPID_LOG(LEVEL, MESSAGE) QPID_LOG_IF(LEVEL, true, MESSAGE);
 
+/**
+ * Macro for log statements. Example of use:
+ * @code
+ * QPID_LOG_CAT(debug, System, "There are " << foocount << " foos in the bar.");
+ * QPID_LOG_CAT(error, System, boost::format("Dohickey %s exploded") % dohicky.name());
+ * @endcode
+ * Using QPID_LOG_CAT requires the specification of a category.
+ *
+ * You can subscribe to log messages by level, by component, by filename
+ * or a combination @see Configuration.
+ *
+ *@param LEVEL severity Level for message, should be one of:
+ * debug, info, notice, warning, error, critical. NB no qpid::log:: prefix.
+ *@param CATEGORY basic Category for the message.
+ *@param MESSAGE any object with an @eostream operator<<, or a sequence
+ * like of ostreamable objects separated by @e<<.
+ */
+#define QPID_LOG_CAT(LEVEL, CATEGORY, MESSAGE) QPID_LOG_IF_CAT(LEVEL, CATEGORY, true, MESSAGE);
+
 }} // namespace qpid::log
 
 

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/management/Buffer.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/management/Buffer.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/management/Buffer.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/management/Buffer.h Thu Jun 28 09:14:52 2012
@@ -46,13 +46,12 @@ public:
     QPID_COMMON_EXTERN Buffer(char* data=0, uint32_t size=0);
     QPID_COMMON_EXTERN ~Buffer();
 
-    QPID_COMMON_EXTERN void record();
-    QPID_COMMON_EXTERN void restore(bool reRecord = false);
     QPID_COMMON_EXTERN void reset();
 
     QPID_COMMON_EXTERN uint32_t available();
     QPID_COMMON_EXTERN uint32_t getSize();
     QPID_COMMON_EXTERN uint32_t getPosition();
+    QPID_COMMON_EXTERN void setPosition(uint32_t);
     QPID_COMMON_EXTERN char* getPointer();
 
     QPID_COMMON_EXTERN void putOctet(uint8_t i);

Modified: qpid/branches/java-config-and-management/qpid/cpp/include/qpid/sys/SystemInfo.h
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/include/qpid/sys/SystemInfo.h?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/include/qpid/sys/SystemInfo.h (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/include/qpid/sys/SystemInfo.h Thu Jun 28 09:14:52 2012
@@ -34,51 +34,61 @@ namespace sys {
  * Results may be dependent on OS/hardware.
  */
 namespace SystemInfo {
-    /**
-     * Estimate available concurrency, e.g. number of CPU cores.
-     * -1 means estimate not available on this platform.
-     */
-    QPID_COMMON_EXTERN long concurrency();
-
-    /**
-     * Get the local host name and set it in the specified.
-     * Returns false if it can't be obtained and sets errno to any error value.
-     */
-    QPID_COMMON_EXTERN bool getLocalHostname (Address &address);
-
-    QPID_COMMON_EXTERN void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList);
-
-    /**
-     * Retrieve system identifiers and versions. This is information that can
-     * generally be retrieved via POSIX uname().
-     *
-     * @param osName   Receives the OS name; e.g., GNU/Linux or Windows
-     * @param nodeName Receives the nodename. This may or may not match the
-     *                 set hostname from getLocalHostname().
-     * @param release  Receives the OS release identifier.
-     * @param version  Receives the OS release version (kernel, build, sp, etc.)
-     * @param machine  Receives the hardware type.
-     */
-    QPID_COMMON_EXTERN void getSystemId (std::string &osName,
-                      std::string &nodeName,
-                      std::string &release,
-                      std::string &version,
-                      std::string &machine);
-
-    /**
-     * Get the process ID of the current process.
-     */
-    QPID_COMMON_EXTERN uint32_t getProcessId();
-
-    /**
-     * Get the process ID of the parent of the current process.
-     */
-    QPID_COMMON_EXTERN uint32_t getParentProcessId();
-
-    /**
-     * Get the name of the current process (i.e. the name of the executable)
-     */
-    QPID_COMMON_EXTERN std::string getProcessName();
+/**
+ * Estimate available concurrency, e.g. number of CPU cores.
+ * -1 means estimate not available on this platform.
+ */
+QPID_COMMON_EXTERN long concurrency();
+
+/**
+ * Get the local host name and set it in the specified.
+ * Returns false if it can't be obtained and sets errno to any error value.
+ */
+QPID_COMMON_EXTERN bool getLocalHostname (Address &address);
+
+/**
+ * Get the (possibly multiple) local IP addresses of this host
+ * using the specified port.
+ */
+QPID_COMMON_EXTERN void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList);
+
+/**
+ * Return true if host names an address of the local host.
+ *@param host host name or IP address.
+ */
+QPID_COMMON_EXTERN bool isLocalHost(const std::string& host);
+
+/**
+ * Retrieve system identifiers and versions. This is information that can
+ * generally be retrieved via POSIX uname().
+ *
+ * @param osName   Receives the OS name; e.g., GNU/Linux or Windows
+ * @param nodeName Receives the nodename. This may or may not match the
+ *                 set hostname from getLocalHostname().
+ * @param release  Receives the OS release identifier.
+ * @param version  Receives the OS release version (kernel, build, sp, etc.)
+ * @param machine  Receives the hardware type.
+ */
+QPID_COMMON_EXTERN void getSystemId (std::string &osName,
+                                     std::string &nodeName,
+                                     std::string &release,
+                                     std::string &version,
+                                     std::string &machine);
+
+/**
+ * Get the process ID of the current process.
+ */
+QPID_COMMON_EXTERN uint32_t getProcessId();
+
+/**
+ * Get the process ID of the parent of the current process.
+ */
+QPID_COMMON_EXTERN uint32_t getParentProcessId();
+
+/**
+ * Get the name of the current process (i.e. the name of the executable)
+ */
+QPID_COMMON_EXTERN std::string getProcessName();
 
 
 }}} // namespace qpid::sys::SystemInfo

Modified: qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/management-types.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/management-types.xml?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/management-types.xml (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/management-types.xml Thu Jun 28 09:14:52 2012
@@ -35,7 +35,7 @@
 <type name="int16"     base="S16"       cpp="int16_t"       encode="@.putInt16(#)"       decode="# = @.getInt16()"     stream="#" size="2" accessor="direct" init="0"/>
 <type name="int32"     base="S32"       cpp="int32_t"       encode="@.putInt32(#)"       decode="# = @.getInt32()"     stream="#" size="4" accessor="direct" init="0"/>
 <type name="int64"     base="S64"       cpp="int64_t"       encode="@.putInt64(#)"       decode="# = @.getInt64()"     stream="#" size="8" accessor="direct" init="0"/>
-<type name="bool"      base="BOOL"      cpp="bool"       encode="@.putOctet(#?1:0)"   decode="# = @.getOctet()==1"  stream="#" size="1" accessor="direct" init="0"/>
+<type name="bool"      base="BOOL"      cpp="bool"          encode="@.putOctet(#?1:0)"   decode="# = @.getOctet()==1"  stream="#" size="1" accessor="direct" init="false"/>
 <type name="sstr"      base="SSTR"      cpp="std::string"   encode="@.putShortString(#)" decode="@.getShortString(#)"  stream="#" size="(1 + #.length())" accessor="direct" init='""' byRef="y" unmap="(#).getString()"/>
 <type name="lstr"      base="LSTR"      cpp="std::string"   encode="@.putMediumString(#)" decode="@.getMediumString(#)" stream="#" size="(2 + #.length())" accessor="direct" init='""' byRef="y" unmap="(#).getString()"/>
 <type name="absTime"   base="ABSTIME"   cpp="int64_t"       encode="@.putLongLong(#)"    decode="# = @.getLongLong()"  stream="#" size="8" accessor="direct" init="0"/>

Modified: qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/schema.py
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/schema.py?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/schema.py (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/schema.py Thu Jun 28 09:14:52 2012
@@ -225,8 +225,7 @@ class SchemaType:
   def genRead (self, stream, varName, indent="    "):
     stream.write(indent + self.decode.replace("@", "buf").replace("#", varName) + ";\n")
 
-  def genUnmap (self, stream, varName, indent="    ", key=None, mapName="_map",
-                _optional=False):
+  def genUnmap (self, stream, varName, indent="    ", key=None, mapName="_map", _optional=False, _default=None):
     if key is None:
       key = varName
     stream.write(indent + "if ((_i = " + mapName + ".find(\"" + key + "\")) != " + mapName + ".end()) {\n")
@@ -234,6 +233,11 @@ class SchemaType:
                  self.unmap.replace("#", "_i->second") + ";\n")
     if _optional:
         stream.write(indent + "    _found = true;\n")
+    stream.write(indent + "} else {\n")
+    default = _default
+    if not default:
+        default = self.init
+    stream.write(indent + "    " + varName + " = " + default + ";\n")
     stream.write(indent + "}\n")
 
   def genWrite (self, stream, varName, indent="    "):
@@ -1405,7 +1409,9 @@ class SchemaClass:
                                  "ioArgs." + arg.dir.lower () + "_" + arg.name,
                                  "        ",
                                  arg.name,
-                                 "inMap")
+                                 "inMap",
+                                 False,
+                                 arg.default)
 
       stream.write ("        bool allow = coreObject->AuthorizeMethod(METHOD_" +\
                     method.getName().upper() + ", ioArgs, userId);\n")

Modified: qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/templates/Class.cpp?rev=1354874&r1=1354873&r2=1354874&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/templates/Class.cpp (original)
+++ qpid/branches/java-config-and-management/qpid/cpp/managementgen/qmfgen/templates/Class.cpp Thu Jun 28 09:14:52 2012
@@ -29,6 +29,7 @@
 /*MGEN:Class.MethodArgIncludes*/
 #include <iostream>
 #include <sstream>
+#include <string.h>
 
 using namespace qmf::/*MGEN:Class.Namespace*/;
 using           qpid::management::ManagementAgent;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org