qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1333027 [2/13] - in /qpid/branches/qpid-3767/qpid: ./ cpp/ cpp/bindings/ cpp/bindings/qmf/ruby/ cpp/bindings/qpid/python/ cpp/bindings/qpid/ruby/ cpp/bindings/qpid/ruby/features/step_definitions/ cpp/bindings/qpid/ruby/lib/qpid/ cpp/docs/a...
Date Wed, 02 May 2012 13:10:03 GMT

Propchange: qpid/branches/qpid-3767/qpid/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/bindings/qmf/ruby/qmf.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qmf/ruby/qmf.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qmf/ruby/qmf.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qmf/ruby/qmf.rb Wed May  2 13:09:18 2012
@@ -26,18 +26,28 @@ module Qmf
 
   # Pull all the TYPE_* constants into Qmf namespace.  Maybe there's an easier way?
   Qmfengine.constants.each do |c|
+    c = c.to_s
     if c.index('TYPE_') == 0 or c.index('ACCESS_') == 0 or c.index('DIR_') == 0 or
         c.index('CLASS_') == 0 or c.index('SEV_') == 0
       const_set(c, Qmfengine.const_get(c))
     end
   end
 
+  module StringHelpers
+    def ensure_encoding(str)
+      enc = (Encoding.default_external.name || "UTF-8" rescue "UTF-8")
+      str.respond_to?(:force_encoding) ? str.force_encoding(enc) : str
+    end
+  end
+
   class Util
+    include StringHelpers
+
     def qmf_to_native(val)
       case val.getType
       when TYPE_UINT8, TYPE_UINT16, TYPE_UINT32 then val.asUint
       when TYPE_UINT64                          then val.asUint64
-      when TYPE_SSTR, TYPE_LSTR                 then val.asString
+      when TYPE_SSTR, TYPE_LSTR                 then ensure_encoding(val.asString)
       when TYPE_ABSTIME                         then val.asInt64
       when TYPE_DELTATIME                       then val.asUint64
       when TYPE_REF                             then ObjectId.new(val.asObjectId)
@@ -161,6 +171,7 @@ module Qmf
   ##==============================================================================
 
   class ConnectionSettings
+    include StringHelpers
     attr_reader :impl
 
     def initialize(url = nil)
@@ -192,7 +203,7 @@ module Qmf
     def get_attr(key)
       _v = @impl.getAttr(key)
       if _v.isString()
-        return _v.asString()
+        return ensure_encoding(_v.asString())
       elsif _v.isUint()
         return _v.asUint()
       elsif _v.isBool()
@@ -348,7 +359,7 @@ module Qmf
       @broker = kwargs[:broker] if kwargs.include?(:broker)
       @allow_sets = :true
 
-      if cls:
+      if cls
         @event_class = cls
         @impl = Qmfengine::Event.new(@event_class.impl)
       elsif kwargs.include?(:impl)
@@ -434,7 +445,7 @@ module Qmf
       @allow_sets = :false
       @broker = kwargs[:broker] if kwargs.include?(:broker)
 
-      if cls:
+      if cls
         @object_class = cls
         @impl = Qmfengine::Object.new(@object_class.impl)
       elsif kwargs.include?(:impl)
@@ -707,6 +718,8 @@ module Qmf
   end
 
   class MethodResponse
+    include StringHelpers
+
     def initialize(impl)
       @impl = Qmfengine::MethodResponse.new(impl)
     end
@@ -720,7 +733,7 @@ module Qmf
     end
 
     def text
-      exception.asString
+      ensure_encoding(exception.asString)
     end
 
     def args
@@ -885,6 +898,7 @@ module Qmf
   end
 
   class SchemaClassKey
+    include StringHelpers
     attr_reader :impl
     def initialize(i)
       @impl = Qmfengine::SchemaClassKey.new(i)
@@ -899,7 +913,7 @@ module Qmf
     end
 
     def to_s
-      @impl.asString
+      ensure_encoding(@impl.asString)
     end
   end
 

Modified: qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/python/python.i
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/python/python.i?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/python/python.i (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/python/python.i Wed May  2 13:09:18 2012
@@ -132,7 +132,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 +199,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 +208,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 +236,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 +301,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 +325,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 +352,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/qpid-3767/qpid/cpp/bindings/qpid/ruby/README.rdoc
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/README.rdoc?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/README.rdoc (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/README.rdoc Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/bindings/qpid/ruby/Rakefile
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/Rakefile?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/Rakefile (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/Rakefile Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb Wed May  2 13:09:18 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 Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set to "([^"]*)"$/ do |name, subject, key, value|
   options = Hash.new
   options["#{key}"] = "#{value}"

Modified: qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb Wed May  2 13:09:18 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

Modified: qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/qpid/ruby/lib/qpid/version.rb Wed May  2 13:09:18 2012
@@ -22,7 +22,7 @@ module Qpid
   module Version
 
     NUMBERS = [MAJOR = 0,
-               MINOR = 13,
+               MINOR = 17,
                BUILD = 0]
   end
 

Modified: qpid/branches/qpid-3767/qpid/cpp/bindings/swig_python_typemaps.i
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/bindings/swig_python_typemaps.i?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/bindings/swig_python_typemaps.i (original)
+++ qpid/branches/qpid-3767/qpid/cpp/bindings/swig_python_typemaps.i Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/configure.ac
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/configure.ac?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/configure.ac (original)
+++ qpid/branches/qpid-3767/qpid/cpp/configure.ac Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/docs/api/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/docs/api:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/etc/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/etc/Makefile.am?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/etc/Makefile.am (original)
+++ qpid/branches/qpid-3767/qpid/cpp/etc/Makefile.am Wed May  2 13:09:18 2012
@@ -33,7 +33,6 @@ nobase_sysconf_DATA = \
 if HAVE_SASL
 nobase_sysconf_DATA += \
 	$(SASL_CONF)
-
 endif
 
 # Substitute values for directories in init scripts.
@@ -46,10 +45,11 @@ qpidd: qpidd.in
 	sed $(SUBST) $< > $@
 qpidd-primary: qpidd-primary.in
 	sed $(SUBST) $< > $@
-cluster.conf-example.xml: cluster.conf-example.in
+cluster.conf-example.xml: cluster.conf-example.xml.in
 	sed $(SUBST) $< > $@
 
-CLEANFILES = qpidd qpidd-primary cluster.conf-example
+CLEANFILES = qpidd qpidd-primary cluster.conf-example.xml
 
 initddir = $(sysconfdir)/init.d
 nobase_initd_SCRIPTS = qpidd qpidd-primary
+

Modified: qpid/branches/qpid-3767/qpid/cpp/etc/cluster.conf-example.xml.in
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/etc/cluster.conf-example.xml.in?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/etc/cluster.conf-example.xml.in (original)
+++ qpid/branches/qpid-3767/qpid/cpp/etc/cluster.conf-example.xml.in Wed May  2 13:09:18 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>
 

Modified: qpid/branches/qpid-3767/qpid/cpp/etc/qpidd.in
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/etc/qpidd.in?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/etc/qpidd.in (original)
+++ qpid/branches/qpid-3767/qpid/cpp/etc/qpidd.in Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj:r1306564-1332660

Propchange: qpid/branches/qpid-3767/qpid/cpp/include/qmf/engine/Agent.h
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/include/qmf/engine/Agent.h:r1306564-1332660

Propchange: qpid/branches/qpid-3767/qpid/cpp/include/qmf/engine/Console.h
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/include/qmf/engine/Console.h:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/include/qpid/Options.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/include/qpid/Options.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/include/qpid/Options.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/include/qpid/Options.h Wed May  2 13:09:18 2012
@@ -163,10 +163,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/qpid-3767/qpid/cpp/include/qpid/Url.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/include/qpid/Url.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/include/qpid/Url.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/include/qpid/Url.h Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/include/qpid/framing/Array.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/include/qpid/framing/Array.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/include/qpid/framing/Array.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/include/qpid/framing/Array.h Wed May  2 13:09:18 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->get<R>();
     }
 
   private:

Modified: qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/management-types.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/management-types.xml?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/management-types.xml (original)
+++ qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/management-types.xml Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/managementgen/qmfgen/schema.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/schema.py?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/schema.py (original)
+++ qpid/branches/qpid-3767/qpid/cpp/managementgen/qmfgen/schema.py Wed May  2 13:09:18 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/qpid-3767/qpid/cpp/rubygen/framing.0-10/structs.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/rubygen/framing.0-10/structs.rb?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/rubygen/framing.0-10/structs.rb (original)
+++ qpid/branches/qpid-3767/qpid/cpp/rubygen/framing.0-10/structs.rb Wed May  2 13:09:18 2012
@@ -185,6 +185,13 @@ class StructGen < CppGen
     end
   end
 
+  def check_field(f)
+    if (size = StringSizeMap[f.cpptype.encoded] and size < 4)
+      limit = 2 ** (size * 8)
+      genl "if (#{f.cppname}.size() >= #{limit}) throw IllegalArgumentException(\"Value for #{f.cppname} is too large\");"
+    end
+  end
+
   def process_packed_fields(s)
     s.fields.each { |f| yield f, s.fields.index(f) }
   end
@@ -260,11 +267,16 @@ EOS
         indent {
           process_packed_fields(s) { |f, i| genl "set#{f.name.caps}(_#{f.cppname});" if f.type_ == "bit"}
           process_packed_fields(s) { |f, i| genl "flags |= #{flag_mask(s, i)};" unless f.type_ == "bit"}
+          s.fields.each { |f| check_field(f) }
         }
         genl "}"          
       else
         indent { gen s.fields.collect { |f| " #{f.cppname}(_#{f.cppname})" }.join(",\n") }
-        genl "{}"
+        genl "{"
+        indent {
+          s.fields.each { |f| check_field(f) }
+        }
+        genl "}"
       end
     end
     #default constructors:
@@ -298,6 +310,7 @@ EOS
       indent {
         genl "#{f.cppname} = _#{f.cppname};"
         genl "flags |= #{flag_mask(s, i)};"
+        check_field(f)
       }
       genl "}"
       genl "#{f.cpptype.ret} #{s.cppname}::get#{f.name.caps}() const { return #{f.cppname}; }"
@@ -329,6 +342,7 @@ EOS
       indent {
         genl "#{f.cppname} = _#{f.cppname};"
         genl "flags |= #{flag_mask(s, i)};"
+        check_field(f)
       }
       genl "}"
       genl "#{f.cpptype.ret} #{s.body_name}::get#{f.name.caps}() const { return #{f.cppname}; }"
@@ -364,7 +378,12 @@ EOS
   end
 
   def define_accessors(f)
-    genl "void set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) { #{f.cppname} = _#{f.cppname}; }"
+    genl "void set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) {"
+    indent {
+      genl "#{f.cppname} = _#{f.cppname};"
+      check_field(f)
+    }
+    genl "}"
     genl "#{f.cpptype.ret} get#{f.name.caps}() const { return #{f.cppname}; }"
     if (f.cpptype.name == "FieldTable")
       genl "#{f.cpptype.name}& get#{f.name.caps}() { return #{f.cppname}; }"
@@ -401,6 +420,7 @@ EOS
 
 #include <ostream>
 #include "qpid/framing/amqp_types_full.h"
+#include "qpid/framing/reply_exceptions.h"
 #include "qpid/CommonImportExport.h"
 
 namespace qpid {
@@ -465,7 +485,7 @@ EOS
       end
       gen <<EOS
 #include "qpid/framing/#{classname}.h"
-#include "qpid/framing/reply_exceptions.h"
+#include "qpid/framing/Buffer.h"
 
 using namespace qpid::framing;
 

Propchange: qpid/branches/qpid-3767/qpid/cpp/src/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/CMakeLists.txt?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/CMakeLists.txt Wed May  2 13:09:18 2012
@@ -354,6 +354,7 @@ endif (NOT Boost_REGEX_LIBRARY)
 # Boost on Windows can use automatic linking to pick up the correct
 # Boost libs based on compile-time touching of the headers. Since we don't
 # really need to add them to the link lines, set the names to blanks.
+option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link static)" ON)
 if (MSVC)
    install (PROGRAMS
             ${Boost_DATE_TIME_LIBRARY_DEBUG} ${Boost_DATE_TIME_LIBRARY_RELEASE}
@@ -371,7 +372,6 @@ if (MSVC)
                COMPONENT ${QPID_COMPONENT_COMMON})
    endif (NOT Boost_VERSION LESS 103500)
 
-   option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link static)" ON)
    if (QPID_LINK_BOOST_DYNAMIC)
       add_definitions( /D BOOST_ALL_DYN_LINK)
       string (REPLACE .lib .dll
@@ -594,6 +594,8 @@ if (BUILD_ACL)
   set (acl_SOURCES
        qpid/acl/Acl.cpp
        qpid/acl/Acl.h
+       qpid/acl/AclConnectionCounter.cpp
+       qpid/acl/AclConnectionCounter.h
        qpid/acl/AclData.cpp
        qpid/acl/AclData.h
        qpid/acl/AclPlugin.cpp
@@ -632,6 +634,8 @@ if (BUILD_HA)
         qpid/ha/Settings.h
         qpid/ha/QueueReplicator.h
         qpid/ha/QueueReplicator.cpp
+	qpid/ha/ReplicateLevel.h
+	qpid/ha/ReplicateLevel.cpp
         qpid/ha/ReplicatingSubscription.h
         qpid/ha/ReplicatingSubscription.cpp
         qpid/ha/BrokerReplicator.cpp
@@ -642,7 +646,7 @@ if (BUILD_HA)
 
     add_library (ha MODULE ${ha_SOURCES})
     set_target_properties (ha PROPERTIES PREFIX "")
-    target_link_libraries (ha qpidbroker ${Boost_PROGRAM_OPTIONS_LIBRARY})
+    target_link_libraries (ha qpidcommon qpidbroker ${Boost_PROGRAM_OPTIONS_LIBRARY})
     if (CMAKE_COMPILER_IS_GNUCXX)
       set_target_properties (ha PROPERTIES
                              PREFIX ""
@@ -1111,6 +1115,7 @@ set (qpidbroker_SOURCES
      qpid/broker/NameGenerator.cpp
      qpid/broker/NullMessageStore.cpp
      qpid/broker/QueueBindings.cpp
+     qpid/broker/QueuedMessage.cpp
      qpid/broker/QueueEvents.cpp
      qpid/broker/QueuePolicy.cpp
      qpid/broker/QueueRegistry.cpp

Propchange: qpid/branches/qpid-3767/qpid/cpp/src/CMakeLists.txt
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src/CMakeLists.txt:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/src/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/Makefile.am?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/Makefile.am (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/Makefile.am Wed May  2 13:09:18 2012
@@ -140,7 +140,7 @@ tmoduleexec_LTLIBRARIES=
 AM_CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=2
 
 ## Automake macros to build libraries and executables.
-qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduleexecdir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\"
+qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduleexecdir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\"
 libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduleexecdir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\"
 
 qpidd_LDADD =					\
@@ -634,6 +634,7 @@ libqpidbroker_la_SOURCES = \
   qpid/broker/QueuePolicy.h \
   qpid/broker/QueueRegistry.cpp \
   qpid/broker/QueueRegistry.h \
+  qpid/broker/QueuedMessage.cpp \
   qpid/broker/QueuedMessage.h \
   qpid/broker/QueueFlowLimit.h \
   qpid/broker/QueueFlowLimit.cpp \

Modified: qpid/branches/qpid-3767/qpid/cpp/src/acl.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/acl.mk?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/acl.mk (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/acl.mk Wed May  2 13:09:18 2012
@@ -24,6 +24,8 @@ dmoduleexec_LTLIBRARIES += acl.la
 acl_la_SOURCES = \
   qpid/acl/Acl.cpp \
   qpid/acl/Acl.h \
+  qpid/acl/AclConnectionCounter.cpp \
+  qpid/acl/AclConnectionCounter.h \
   qpid/acl/AclData.cpp \
   qpid/acl/AclData.h \
   qpid/acl/AclPlugin.cpp \

Modified: qpid/branches/qpid-3767/qpid/cpp/src/ha.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/ha.mk?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/ha.mk (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/ha.mk Wed May  2 13:09:18 2012
@@ -25,18 +25,20 @@ dmoduleexec_LTLIBRARIES += ha.la
 ha_la_SOURCES =					\
   qpid/ha/Backup.cpp				\
   qpid/ha/Backup.h				\
+  qpid/ha/BrokerReplicator.cpp			\
+  qpid/ha/BrokerReplicator.h                    \
+  qpid/ha/ConnectionExcluder.cpp		\
+  qpid/ha/ConnectionExcluder.h			\
   qpid/ha/HaBroker.cpp				\
   qpid/ha/HaBroker.h				\
   qpid/ha/HaPlugin.cpp				\
-  qpid/ha/Settings.h				\
-  qpid/ha/QueueReplicator.h			\
   qpid/ha/QueueReplicator.cpp			\
-  qpid/ha/ReplicatingSubscription.h		\
+  qpid/ha/QueueReplicator.h			\
+  qpid/ha/ReplicateLevel.cpp			\
+  qpid/ha/ReplicateLevel.h			\
   qpid/ha/ReplicatingSubscription.cpp		\
-  qpid/ha/BrokerReplicator.cpp			\
-  qpid/ha/BrokerReplicator.h                    \
-  qpid/ha/ConnectionExcluder.cpp		\
-  qpid/ha/ConnectionExcluder.h
+  qpid/ha/ReplicatingSubscription.h		\
+  qpid/ha/Settings.h
 
 ha_la_LIBADD = libqpidbroker.la
 ha_la_LDFLAGS = $(PLUGINLDFLAGS)

Modified: qpid/branches/qpid-3767/qpid/cpp/src/posix/QpiddBroker.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/posix/QpiddBroker.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/posix/QpiddBroker.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/posix/QpiddBroker.cpp Wed May  2 13:09:18 2012
@@ -39,7 +39,7 @@ namespace broker {
 
 BootstrapOptions::BootstrapOptions(const char* argv0)
   : qpid::Options("Options"),
-    common("", QPIDD_CONF_FILE),
+    common("", QPIDD_CONF_FILE, QPIDC_CONF_FILE),
     module(QPIDD_MODULE_DIR),
     log(argv0)
 {
@@ -91,7 +91,7 @@ struct QpiddPosixOptions : public QpiddO
 
 QpiddOptions::QpiddOptions(const char* argv0)
   : qpid::Options("Options"),
-    common("", QPIDD_CONF_FILE),
+    common("", QPIDD_CONF_FILE, QPIDC_CONF_FILE),
     module(QPIDD_MODULE_DIR),
     log(argv0)
 {

Propchange: qpid/branches/qpid-3767/qpid/cpp/src/qmf/engine/Agent.cpp
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src/qmf/engine/Agent.cpp:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/Options.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/Options.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/Options.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/Options.cpp Wed May  2 13:09:18 2012
@@ -186,13 +186,14 @@ void Options::parse(int argc, char const
     }
 }
 
-CommonOptions::CommonOptions(const string& name, const string& configfile)
-    : Options(name), config(configfile)
+CommonOptions::CommonOptions(const string& name, const string& configfile, const string& clientfile)
+    : Options(name), config(configfile), clientConfig(clientfile)
 {
     addOptions()
         ("help,h", optValue(help), "Displays the help message")
         ("version,v", optValue(version), "Displays version information")
-        ("config", optValue(config, "FILE"), "Reads configuration from FILE");
+        ("config", optValue(config, "FILE"), "Reads configuration from FILE")
+        ("client-config", optValue(clientConfig, "FILE"), "Reads client configuration from FILE (for cluster interconnect)");
 }
 
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.cpp Wed May  2 13:09:18 2012
@@ -20,6 +20,8 @@
  */
 #include "UrlArray.h"
 
+#include <qpid/framing/FieldValue.h>
+
 namespace qpid {
 
 std::vector<Url> urlArrayToVector(const framing::Array& array) {

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/UrlArray.h Wed May  2 13:09:18 2012
@@ -23,7 +23,6 @@
  */
 
 #include "qpid/framing/Array.h"
-#include "qpid/framing/FieldValue.h"
 #include "qpid/Url.h"
 #include <vector>
 

Propchange: qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src/qpid/acl:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.cpp Wed May  2 13:09:18 2012
@@ -17,6 +17,7 @@
  */
 
 #include "qpid/acl/Acl.h"
+#include "qpid/acl/AclConnectionCounter.h"
 #include "qpid/acl/AclData.h"
 #include "qpid/acl/AclValidator.h"
 #include "qpid/sys/Mutex.h"
@@ -26,6 +27,8 @@
 #include "qpid/Options.h"
 #include "qpid/log/Logger.h"
 #include "qpid/types/Variant.h"
+#include "qmf/org/apache/qpid/acl/ArgsAclLookup.h"
+#include "qmf/org/apache/qpid/acl/ArgsAclLookupPublish.h"
 #include "qmf/org/apache/qpid/acl/Package.h"
 #include "qmf/org/apache/qpid/acl/EventAllow.h"
 #include "qmf/org/apache/qpid/acl/EventDeny.h"
@@ -35,7 +38,6 @@
 #include <map>
 
 #include <boost/shared_ptr.hpp>
-#include <boost/utility/in_place_factory.hpp>
 
 using namespace std;
 using namespace qpid::acl;
@@ -47,7 +49,8 @@ using qpid::management::Manageable;
 using qpid::management::Args;
 namespace _qmf = qmf::org::apache::qpid::acl;
 
-Acl::Acl (AclValues& av, Broker& b): aclValues(av), broker(&b), transferAcl(false), mgmtObject(0)
+Acl::Acl (AclValues& av, Broker& b): aclValues(av), broker(&b), transferAcl(false), mgmtObject(0),
+    connectionCounter(new ConnectionCounter(aclValues.aclMaxConnectPerUser, aclValues.aclMaxConnectPerIp))
 {
 
     agent = broker->getManagementAgent();
@@ -62,6 +65,7 @@ Acl::Acl (AclValues& av, Broker& b): acl
         throw Exception("Could not read ACL file " + errorString);
         if (mgmtObject!=0) mgmtObject->set_enforcingAcl(0);
     }
+    broker->getConnectionObservers().add(connectionCounter);
     QPID_LOG(info, "ACL Plugin loaded");
     if (mgmtObject!=0) mgmtObject->set_enforcingAcl(1);
 }
@@ -193,14 +197,89 @@ bool Acl::readAclFile(std::string& aclFi
     return true;
 }
 
-Acl::~Acl(){}
+
+//
+// management lookup function performs general query on acl engine
+//
+Manageable::status_t Acl::lookup(qpid::management::Args& args, std::string& text)
+{
+    _qmf::ArgsAclLookup& ioArgs = (_qmf::ArgsAclLookup&) args;
+    Manageable::status_t result(STATUS_USER);
+
+   try {
+        ObjectType   objType = AclHelper::getObjectType(ioArgs.i_object);
+        Action       action  = AclHelper::getAction(    ioArgs.i_action);
+        std::map<Property, std::string> propertyMap;
+        for (::qpid::types::Variant::Map::const_iterator
+             iMapIter  = ioArgs.i_propertyMap.begin();
+             iMapIter != ioArgs.i_propertyMap.end();
+             iMapIter++)
+        {
+            Property property = AclHelper::getProperty(iMapIter->first);
+            propertyMap.insert(make_pair(property, iMapIter->second));
+        }
+
+        boost::shared_ptr<AclData> dataLocal;
+        {
+            Mutex::ScopedLock locker(dataLock);
+            dataLocal = data;  //rcu copy
+        }
+        AclResult aclResult = dataLocal->lookup(
+            ioArgs.i_userId,
+            action,
+            objType,
+            ioArgs.i_objectName,
+            &propertyMap);
+
+        ioArgs.o_result = AclHelper::getAclResultStr(aclResult);
+        result = STATUS_OK;
+
+    } catch (const std::exception& e) {
+        std::ostringstream oss;
+        oss << "AclLookup invalid name : " << e.what();
+        ioArgs.o_result =  oss.str();
+        text = oss.str();
+    }
+
+    return result;
+}
+
+
+//
+// management lookupPublish function performs fastpath
+// PUBLISH EXCHANGE query on acl engine
+//
+Manageable::status_t Acl::lookupPublish(qpid::management::Args& args, std::string& /*text*/)
+{
+    _qmf::ArgsAclLookupPublish& ioArgs = (_qmf::ArgsAclLookupPublish&) args;
+    boost::shared_ptr<AclData>       dataLocal;
+    {
+        Mutex::ScopedLock locker(dataLock);
+        dataLocal = data;  //rcu copy
+    }
+    AclResult aclResult = dataLocal->lookup(
+        ioArgs.i_userId,
+        ACT_PUBLISH,
+        OBJ_EXCHANGE,
+        ioArgs.i_exchangeName,
+        ioArgs.i_routingKey);
+
+    ioArgs.o_result = AclHelper::getAclResultStr(aclResult);
+
+    return STATUS_OK;
+}
+
+
+Acl::~Acl(){
+    broker->getConnectionObservers().remove(connectionCounter);
+}
 
 ManagementObject* Acl::GetManagementObject(void) const
 {
     return (ManagementObject*) mgmtObject;
 }
 
-Manageable::status_t Acl::ManagementMethod (uint32_t methodId, Args& /*args*/, string& text)
+Manageable::status_t Acl::ManagementMethod (uint32_t methodId, Args& args, string& text)
 {
     Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
     QPID_LOG (debug, "ACL: Queue::ManagementMethod [id=" << methodId << "]");
@@ -214,6 +293,14 @@ Manageable::status_t Acl::ManagementMeth
         else
             status = Manageable::STATUS_USER;
         break;
+
+    case _qmf::Acl::METHOD_LOOKUP :
+        status = lookup(args, text);
+        break;
+
+    case _qmf::Acl::METHOD_LOOKUPPUBLISH :
+        status = lookupPublish(args, text);
+        break;
     }
 
     return status;

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/Acl.h Wed May  2 13:09:18 2012
@@ -30,6 +30,7 @@
 #include "qmf/org/apache/qpid/acl/Acl.h"
 #include "qpid/sys/Mutex.h"
 
+#include <boost/shared_ptr.hpp>
 #include <map>
 #include <string>
 
@@ -40,9 +41,12 @@ class Broker;
 }
 
 namespace acl {
+class ConnectionCounter;
 
 struct AclValues {
-	std::string aclFile;
+    std::string aclFile;
+    uint32_t    aclMaxConnectPerUser;
+    uint32_t    aclMaxConnectPerIp;
 };
 
 
@@ -50,54 +54,56 @@ class Acl : public broker::AclModule, pu
 {
 
 private:
-   acl::AclValues aclValues;
-   broker::Broker* broker;
-   bool transferAcl;
-   boost::shared_ptr<AclData> data;
-   qmf::org::apache::qpid::acl::Acl* mgmtObject; // mgnt owns lifecycle
-   qpid::management::ManagementAgent* agent;
-   mutable qpid::sys::Mutex dataLock;
+    acl::AclValues                       aclValues;
+    broker::Broker*                      broker;
+    bool                                 transferAcl;
+    boost::shared_ptr<AclData>           data;
+    qmf::org::apache::qpid::acl::Acl*    mgmtObject; // mgnt owns lifecycle
+    qpid::management::ManagementAgent*   agent;
+    mutable qpid::sys::Mutex             dataLock;
+    boost::shared_ptr<ConnectionCounter> connectionCounter;
 
 public:
-   Acl (AclValues& av, broker::Broker& b);
+    Acl (AclValues& av, broker::Broker& b);
 
-   void initialize();
+    void initialize();
 
-   inline virtual bool doTransferAcl() {return transferAcl;};
+    inline virtual bool doTransferAcl() {
+        return transferAcl;
+    };
+
+// create specilied authorise methods for cases that need faster matching as needed.
+    virtual bool authorise(
+        const std::string&               id,
+        const Action&                    action,
+        const ObjectType&                objType,
+        const std::string&               name,
+        std::map<Property, std::string>* params=0);
+
+    virtual bool authorise(
+        const std::string&               id,
+        const Action&                    action,
+        const ObjectType&                objType,
+        const std::string&               ExchangeName,
+        const std::string&               RoutingKey);
 
-   // create specilied authorise methods for cases that need faster matching as needed.
-   virtual bool authorise(
-       const std::string& id,
-       const Action& action,
-       const ObjectType& objType,
-       const std::string& name,
-       std::map<Property,
-       std::string>* params=0);
-
-   virtual bool authorise(
-       const std::string& id,
-       const Action& action,
-       const ObjectType& objType,
-       const std::string& ExchangeName,
-       const std::string& RoutingKey);
-
-   virtual ~Acl();
+    virtual ~Acl();
 private:
-   bool result(
-       const AclResult& aclreslt,
-       const std::string& id,
-       const Action& action,
-       const ObjectType& objType,
-       const std::string& name);
-   bool readAclFile(std::string& errorText);
-   bool readAclFile(std::string& aclFile, std::string& errorText);
-   virtual qpid::management::ManagementObject* GetManagementObject(void) const;
-   virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
+    bool result(
+        const AclResult&   aclreslt,
+        const std::string& id,
+        const Action&      action,
+        const ObjectType&  objType,
+        const std::string& name);
+    bool readAclFile(std::string& errorText);
+    bool readAclFile(std::string& aclFile, std::string& errorText);
+    Manageable::status_t lookup       (management::Args& args, std::string& text);
+    Manageable::status_t lookupPublish(management::Args& args, std::string& text);
+    virtual qpid::management::ManagementObject* GetManagementObject(void) const;
+    virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
 
 };
 
-
-
 }} // namespace qpid::acl
 
 #endif // QPID_ACL_ACL_H

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclData.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclData.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclData.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclData.cpp Wed May  2 13:09:18 2012
@@ -60,7 +60,7 @@ namespace acl {
     // matchProp
     //
     // Compare a rule's property name with a lookup name,
-    // The rule's name may contains a trailing '*' to specify a wildcard match.
+    // The rule's name may contain a trailing '*' to specify a wildcard match.
     //
     bool AclData::matchProp(const std::string& ruleStr,
                             const std::string& lookupStr)
@@ -312,14 +312,14 @@ namespace acl {
         const Action&                   action,
         const ObjectType&               objType,
         const std::string& /*Exchange*/ name,
-        const std::string&              RoutingKey)
+        const std::string&              routingKey)
     {
 
         QPID_LOG(debug, "ACL: Lookup for id:" << id
             << " action:" << AclHelper::getActionStr((Action) action)
             << " objectType:" << AclHelper::getObjectTypeStr((ObjectType) objType)
             << " exchange name:" << name
-            << " with routing key " << RoutingKey);
+            << " with routing key " << routingKey);
 
         AclResult aclresult = decisionMode;
 
@@ -337,6 +337,8 @@ namespace acl {
                 {
                     rsItr--;
 
+                    QPID_LOG(debug, "ACL: checking rule " <<  rsItr->toString());
+
                     // loop the names looking for match
                     bool match =true;
                     for (specPropertyMapItr pMItr  = rsItr->props.begin();
@@ -364,17 +366,17 @@ namespace acl {
                             break;
 
                         case acl::SPECPROP_ROUTINGKEY:
-                            if (matchProp(pMItr->second, RoutingKey))
+                            if (matchProp(pMItr->second, routingKey))
                             {
                                 QPID_LOG(debug, "ACL: lookup key name '"
-                                    << name << "' matched with rule routing key '"
+                                    << routingKey << "' matched with rule routing key '"
                                     << pMItr->second << "'");
                             }
                             else
                             {
                                 match= false;
                                 QPID_LOG(debug, "ACL: lookup key name '"
-                                    << name << "' did not match with rule routing key '"
+                                    << routingKey << "' did not match with rule routing key '"
                                     << pMItr->second << "'");
                             }
                             break;

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclPlugin.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclPlugin.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclPlugin.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/AclPlugin.cpp Wed May  2 13:09:18 2012
@@ -40,7 +40,9 @@ struct AclOptions : public Options {
 
     AclOptions(AclValues& v) : Options("ACL Options"), values(v) {
         addOptions()
-            ("acl-file", optValue(values.aclFile, "FILE"), "The policy file to load from, loaded from data dir");
+            ("acl-file",           optValue(values.aclFile, "FILE"), "The policy file to load from, loaded from data dir")
+            ("acl-max-connect-per-user", optValue(values.aclMaxConnectPerUser, "N"), "The maximum number of connections allowed per user")
+            ("acl-max-connect-per-ip"  , optValue(values.aclMaxConnectPerIp, "N"),   "The maximum number of connections allowed per host IP address");
     }
 };
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/management-schema.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/management-schema.xml?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/management-schema.xml (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/acl/management-schema.xml Wed May  2 13:09:18 2012
@@ -25,6 +25,37 @@
     <statistic name="aclDenyCount" type="count64" unit="request" desc="Number of ACL requests denied"/>
 
     <method name="reloadACLFile" desc="Reload the ACL file"/>
+
+    <!--
+    Lookup is a general object lookup
+        User Name
+        Action
+        Object
+        Object Name
+        Property Map consisting of <"name" "value"> string pairs.
+    -->
+    <method name="Lookup" desc="Lookup: user action object [objectName [propertyMap]]">
+        <arg name="userId"      dir="I" type="lstr"/>
+        <arg name="action"      dir="I" type="lstr"/>
+        <arg name="object"      dir="I" type="lstr"/>
+        <arg name="objectName"  dir="I" type="lstr"/>
+        <arg name="propertyMap" dir="I" type="map"/>
+        <arg name="result"      dir="O" type="lstr"/>
+    </method>
+
+    <!--
+    LookupPublish is a specific lookup for a PUBLISH EXCHANGE fastpath
+        User Name
+        Exchange Name
+        Routing Key
+    -->
+    <method name="LookupPublish" desc="Lookup PUBLISH EXCHANGE: user exchangeName routingKey">
+        <arg name="userId"       dir="I" type="lstr"/>
+        <arg name="exchangeName" dir="I" type="lstr"/>
+        <arg name="routingKey"   dir="I" type="lstr"/>
+        <arg name="result"       dir="O" type="lstr"/>
+    </method>
+
   </class>
 
   <eventArguments>

Propchange: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src/qpid/broker:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/AclModule.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/AclModule.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/AclModule.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/AclModule.h Wed May  2 13:09:18 2012
@@ -22,6 +22,7 @@
 
 
 #include "qpid/RefCounted.h"
+#include "qpid/Exception.h"
 #include <boost/shared_ptr.hpp>
 #include <map>
 #include <set>
@@ -68,7 +69,6 @@ namespace acl {
         PROP_DURABLE,
         PROP_OWNER,
         PROP_ROUTINGKEY,
-        PROP_PASSIVE,
         PROP_AUTODELETE,
         PROP_EXCLUSIVE,
         PROP_TYPE,
@@ -88,7 +88,6 @@ namespace acl {
         SPECPROP_DURABLE         = PROP_DURABLE,
         SPECPROP_OWNER           = PROP_OWNER,
         SPECPROP_ROUTINGKEY      = PROP_ROUTINGKEY,
-        SPECPROP_PASSIVE         = PROP_PASSIVE,
         SPECPROP_AUTODELETE      = PROP_AUTODELETE,
         SPECPROP_EXCLUSIVE       = PROP_EXCLUSIVE,
         SPECPROP_TYPE            = PROP_TYPE,
@@ -156,7 +155,7 @@ namespace acl {
             if (str.compare("broker")   == 0) return OBJ_BROKER;
             if (str.compare("link")     == 0) return OBJ_LINK;
             if (str.compare("method")   == 0) return OBJ_METHOD;
-            throw str;
+            throw qpid::Exception(str);
         }
         static inline std::string getObjectTypeStr(const ObjectType o) {
             switch (o) {
@@ -179,7 +178,7 @@ namespace acl {
             if (str.compare("delete")  == 0) return ACT_DELETE;
             if (str.compare("purge")   == 0) return ACT_PURGE;
             if (str.compare("update")  == 0) return ACT_UPDATE;
-            throw str;
+            throw qpid::Exception(str);
         }
         static inline std::string getActionStr(const Action a) {
             switch (a) {
@@ -201,7 +200,6 @@ namespace acl {
             if (str.compare("durable")       == 0) return PROP_DURABLE;
             if (str.compare("owner")         == 0) return PROP_OWNER;
             if (str.compare("routingkey")    == 0) return PROP_ROUTINGKEY;
-            if (str.compare("passive")       == 0) return PROP_PASSIVE;
             if (str.compare("autodelete")    == 0) return PROP_AUTODELETE;
             if (str.compare("exclusive")     == 0) return PROP_EXCLUSIVE;
             if (str.compare("type")          == 0) return PROP_TYPE;
@@ -212,7 +210,7 @@ namespace acl {
             if (str.compare("policytype")    == 0) return PROP_POLICYTYPE;
             if (str.compare("maxqueuesize")  == 0) return PROP_MAXQUEUESIZE;
             if (str.compare("maxqueuecount") == 0) return PROP_MAXQUEUECOUNT;
-            throw str;
+            throw qpid::Exception(str);
         }
         static inline std::string getPropertyStr(const Property p) {
             switch (p) {
@@ -220,7 +218,6 @@ namespace acl {
             case PROP_DURABLE:       return "durable";
             case PROP_OWNER:         return "owner";
             case PROP_ROUTINGKEY:    return "routingkey";
-            case PROP_PASSIVE:       return "passive";
             case PROP_AUTODELETE:    return "autodelete";
             case PROP_EXCLUSIVE:     return "exclusive";
             case PROP_TYPE:          return "type";
@@ -240,7 +237,6 @@ namespace acl {
             if (str.compare("durable")       == 0) return SPECPROP_DURABLE;
             if (str.compare("owner")         == 0) return SPECPROP_OWNER;
             if (str.compare("routingkey")    == 0) return SPECPROP_ROUTINGKEY;
-            if (str.compare("passive")       == 0) return SPECPROP_PASSIVE;
             if (str.compare("autodelete")    == 0) return SPECPROP_AUTODELETE;
             if (str.compare("exclusive")     == 0) return SPECPROP_EXCLUSIVE;
             if (str.compare("type")          == 0) return SPECPROP_TYPE;
@@ -256,7 +252,7 @@ namespace acl {
             // Allow old names in ACL file as aliases for newly-named properties
             if (str.compare("maxqueuesize")             == 0) return SPECPROP_MAXQUEUESIZEUPPERLIMIT;
             if (str.compare("maxqueuecount")            == 0) return SPECPROP_MAXQUEUECOUNTUPPERLIMIT;
-            throw str;
+            throw qpid::Exception(str);
         }
         static inline std::string getPropertyStr(const SpecProperty p) {
             switch (p) {
@@ -264,7 +260,6 @@ namespace acl {
                 case SPECPROP_DURABLE:       return "durable";
                 case SPECPROP_OWNER:         return "owner";
                 case SPECPROP_ROUTINGKEY:    return "routingkey";
-                case SPECPROP_PASSIVE:       return "passive";
                 case SPECPROP_AUTODELETE:    return "autodelete";
                 case SPECPROP_EXCLUSIVE:     return "exclusive";
                 case SPECPROP_TYPE:          return "type";
@@ -286,7 +281,7 @@ namespace acl {
             if (str.compare("allow-log") == 0) return ALLOWLOG;
             if (str.compare("deny")      == 0) return DENY;
             if (str.compare("deny-log")  == 0) return DENYLOG;
-            throw str;
+            throw qpid::Exception(str);
         }
         static inline std::string getAclResultStr(const AclResult r) {
             switch (r) {
@@ -325,7 +320,6 @@ namespace acl {
             propSetPtr p1(new propSet);
             p1->insert(PROP_TYPE);
             p1->insert(PROP_ALTERNATE);
-            p1->insert(PROP_PASSIVE);
             p1->insert(PROP_DURABLE);
 
             propSetPtr p2(new propSet);
@@ -350,7 +344,6 @@ namespace acl {
 
             propSetPtr p4(new propSet);
             p4->insert(PROP_ALTERNATE);
-            p4->insert(PROP_PASSIVE);
             p4->insert(PROP_DURABLE);
             p4->insert(PROP_EXCLUSIVE);
             p4->insert(PROP_AUTODELETE);

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.cpp Wed May  2 13:09:18 2012
@@ -62,7 +62,7 @@ Bridge::Bridge(const std::string& _name,
                InitializeCallback init) :
     link(_link), id(_id), args(_args), mgmtObject(0),
     listener(l), name(_name), queueName("qpid.bridge_queue_"), persistenceId(0),
-    initialize(init)
+    initialize(init), detached(false)
 {
     std::stringstream title;
     title << id << "_" << name;
@@ -86,11 +86,14 @@ Bridge::~Bridge()
 
 void Bridge::create(Connection& c)
 {
+    detached = false;           // Reset detached in case we are recovering.
     connState = &c;
     conn = &c;
     FieldTable options;
     if (args.i_sync) options.setInt("qpid.sync_frequency", args.i_sync);
     SessionHandler& sessionHandler = c.getChannel(id);
+    sessionHandler.setDetachedCallback(
+        boost::bind(&Bridge::sessionDetached, shared_from_this()));
     if (args.i_srcIsLocal) {
         if (args.i_dynamic)
             throw Exception("Dynamic routing not supported for push routes");
@@ -182,12 +185,6 @@ void Bridge::close()
     listener(this); // ask the LinkRegistry to destroy us
 }
 
-bool Bridge::isSessionReady() const
-{
-    SessionHandler& sessionHandler = conn->getChannel(id);
-    return sessionHandler.ready();
-}
-
 void Bridge::setPersistenceId(uint64_t pId) const
 {
     persistenceId = pId;
@@ -380,4 +377,8 @@ const string& Bridge::getLocalTag() cons
 {
     return link->getBroker()->getFederationTag();
 }
+void Bridge::sessionDetached() {
+    detached = true;
+}
+
 }}

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Bridge.h Wed May  2 13:09:18 2012
@@ -33,6 +33,7 @@
 #include "qmf/org/apache/qpid/broker/Bridge.h"
 
 #include <boost/function.hpp>
+#include <boost/enable_shared_from_this.hpp>
 #include <memory>
 
 namespace qpid {
@@ -44,7 +45,10 @@ class Link;
 class LinkRegistry;
 class SessionHandler;
 
-class Bridge : public PersistableConfig, public management::Manageable, public Exchange::DynamicBridge
+class Bridge : public PersistableConfig,
+               public management::Manageable,
+               public Exchange::DynamicBridge,
+               public boost::enable_shared_from_this<Bridge>
 {
 public:
     typedef boost::shared_ptr<Bridge> shared_ptr;
@@ -64,7 +68,7 @@ public:
     const std::string getDest() const { return args.i_dest; }
     const std::string getKey() const { return args.i_key; }
 
-    bool isSessionReady() const;
+    bool isDetached() const { return detached; }
 
     management::ManagementObject* GetManagementObject() const;
     management::Manageable::status_t ManagementMethod(uint32_t methodId,
@@ -95,6 +99,9 @@ public:
     const qmf::org::apache::qpid::broker::ArgsLinkBridge& getArgs() { return args; }
 
 private:
+    // Callback when the bridge's session is detached.
+    void sessionDetached();
+
     struct PushHandler : framing::FrameHandler {
         PushHandler(Connection* c) { conn = c; }
         void handle(framing::AMQFrame& frame);
@@ -117,7 +124,7 @@ private:
     ConnectionState* connState;
     Connection* conn;
     InitializeCallback initialize;
-
+    bool detached;              // Set when session is detached.
     bool resetProxy();
 
     // connection Management (called by owning Link)

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Broker.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Broker.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/Broker.cpp Wed May  2 13:09:18 2012
@@ -1056,7 +1056,6 @@ std::pair<boost::shared_ptr<Queue>, bool
     if (acl) {
         std::map<acl::Property, std::string> params;
         params.insert(make_pair(acl::PROP_ALTERNATE, alternateExchange));
-        params.insert(make_pair(acl::PROP_PASSIVE, _FALSE));
         params.insert(make_pair(acl::PROP_DURABLE, durable ? _TRUE : _FALSE));
         params.insert(make_pair(acl::PROP_EXCLUSIVE, owner ? _TRUE : _FALSE));
         params.insert(make_pair(acl::PROP_AUTODELETE, autodelete ? _TRUE : _FALSE));
@@ -1127,7 +1126,6 @@ std::pair<Exchange::shared_ptr, bool> Br
         std::map<acl::Property, std::string> params;
         params.insert(make_pair(acl::PROP_TYPE, type));
         params.insert(make_pair(acl::PROP_ALTERNATE, alternateExchange));
-        params.insert(make_pair(acl::PROP_PASSIVE, _FALSE));
         params.insert(make_pair(acl::PROP_DURABLE, durable ? _TRUE : _FALSE));
         if (!acl->authorise(userId,acl::ACT_CREATE,acl::OBJ_EXCHANGE,name,&params) )
             throw framing::UnauthorizedAccessException(QPID_MSG("ACL denied exchange create request from " << userId));

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp Wed May  2 13:09:18 2012
@@ -28,6 +28,7 @@
 #include "qpid/framing/AllInvoker.h"
 #include "qpid/framing/ConnectionStartOkBody.h"
 #include "qpid/framing/enum.h"
+#include "qpid/framing/FieldValue.h"
 #include "qpid/log/Statement.h"
 #include "qpid/sys/SecurityLayer.h"
 #include "qpid/broker/AclModule.h"

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.cpp Wed May  2 13:09:18 2012
@@ -21,6 +21,7 @@
 #include "qpid/broker/DtxManager.h"
 #include "qpid/broker/DtxTimeout.h"
 #include "qpid/framing/reply_exceptions.h"
+#include "qpid/framing/StructHelper.h"
 #include "qpid/log/Statement.h"
 #include "qpid/sys/Timer.h"
 #include "qpid/ptr_map.h"
@@ -55,7 +56,7 @@ void DtxManager::recover(const std::stri
 
 bool DtxManager::prepare(const std::string& xid)
 {
-    QPID_LOG(debug, "preparing: " << xid);
+    QPID_LOG(debug, "preparing: " << convert(xid));
     try {
         return getWork(xid)->prepare();
     } catch (DtxTimeoutException& e) {
@@ -66,7 +67,7 @@ bool DtxManager::prepare(const std::stri
 
 bool DtxManager::commit(const std::string& xid, bool onePhase)
 {
-    QPID_LOG(debug, "committing: " << xid);
+    QPID_LOG(debug, "committing: " << convert(xid));
     try {
         bool result = getWork(xid)->commit(onePhase);
         remove(xid);
@@ -79,7 +80,7 @@ bool DtxManager::commit(const std::strin
 
 void DtxManager::rollback(const std::string& xid)
 {
-    QPID_LOG(debug, "rolling back: " << xid);
+    QPID_LOG(debug, "rolling back: " << convert(xid));
     try {
         getWork(xid)->rollback();
         remove(xid);
@@ -94,7 +95,7 @@ DtxWorkRecord* DtxManager::getWork(const
     Mutex::ScopedLock locker(lock);
     WorkMap::iterator i = work.find(xid);
     if (i == work.end()) {
-        throw NotFoundException(QPID_MSG("Unrecognised xid " << xid));
+        throw NotFoundException(QPID_MSG("Unrecognised xid " << convert(xid)));
     }
     return ptr_map_ptr(i);
 }
@@ -109,7 +110,7 @@ void DtxManager::remove(const std::strin
     Mutex::ScopedLock locker(lock);
     WorkMap::iterator i = work.find(xid);
     if (i == work.end()) {
-        throw NotFoundException(QPID_MSG("Unrecognised xid " << xid));
+        throw NotFoundException(QPID_MSG("Unrecognised xid " << convert(xid)));
     } else {
         work.erase(i);
     }
@@ -120,7 +121,7 @@ DtxWorkRecord* DtxManager::createWork(co
     Mutex::ScopedLock locker(lock);
     WorkMap::iterator i = work.find(xid);
     if (i != work.end()) {
-        throw NotAllowedException(QPID_MSG("Xid " << xid << " is already known (use 'join' to add work to an existing xid)"));
+        throw NotAllowedException(QPID_MSG("Xid " << convert(xid) << " is already known (use 'join' to add work to an existing xid)"));
     } else {
         std::string ncxid = xid; // Work around const correctness problems in ptr_map.
         return ptr_map_ptr(work.insert(ncxid, new DtxWorkRecord(ncxid, store)).first);
@@ -175,3 +176,19 @@ void DtxManager::setStore (Transactional
 {
     store = _store;
 }
+
+std::string DtxManager::convert(const qpid::framing::Xid& xid)
+{
+    qpid::framing::StructHelper helper;
+    std::string encoded;
+    helper.encode(xid, encoded);
+    return encoded;
+}
+
+qpid::framing::Xid DtxManager::convert(const std::string& xid)
+{
+    qpid::framing::StructHelper helper;
+    qpid::framing::Xid decoded;
+    helper.decode(decoded, xid);
+    return decoded;
+}

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.h?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.h (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxManager.h Wed May  2 13:09:18 2012
@@ -26,6 +26,7 @@
 #include "qpid/broker/DtxWorkRecord.h"
 #include "qpid/broker/TransactionalStore.h"
 #include "qpid/framing/amqp_types.h"
+#include "qpid/framing/Xid.h"
 #include "qpid/sys/Mutex.h"
 #include "qpid/ptr_map.h"
 
@@ -74,6 +75,8 @@ public:
     }
     DtxWorkRecord* getWork(const std::string& xid);
     bool exists(const std::string& xid);
+    static std::string convert(const framing::Xid& xid);
+    static framing::Xid convert(const std::string& xid);
 };
 
 }

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp Wed May  2 13:09:18 2012
@@ -19,6 +19,7 @@
  *
  */
 #include "qpid/broker/DtxWorkRecord.h"
+#include "qpid/broker/DtxManager.h"
 #include "qpid/framing/reply_exceptions.h"
 #include <boost/format.hpp>
 #include <boost/mem_fn.hpp>
@@ -73,7 +74,7 @@ bool DtxWorkRecord::commit(bool onePhase
         if (prepared) {
             //already prepared i.e. 2pc
             if (onePhase) {
-                throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " has been prepared, one-phase option not valid!"));
+                throw IllegalStateException(QPID_MSG("Branch with xid " << DtxManager::convert(xid) << " has been prepared, one-phase option not valid!"));
             }
 
             store->commit(*txn);
@@ -84,7 +85,7 @@ bool DtxWorkRecord::commit(bool onePhase
         } else {
             //1pc commit optimisation, don't need a 2pc transaction context:
             if (!onePhase) {
-                throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " has not been prepared, one-phase option required!"));
+                throw IllegalStateException(QPID_MSG("Branch with xid " << DtxManager::convert(xid) << " has not been prepared, one-phase option required!"));
             }
             std::auto_ptr<TransactionContext> localtxn = store->begin();
             if (prepare(localtxn.get())) {
@@ -116,10 +117,10 @@ void DtxWorkRecord::add(DtxBuffer::share
 {
     Mutex::ScopedLock locker(lock);
     if (expired) {
-        throw DtxTimeoutException(QPID_MSG("Branch with xid " << xid << " has timed out."));
+        throw DtxTimeoutException(QPID_MSG("Branch with xid " << DtxManager::convert(xid) << " has timed out."));
     }
     if (completed) {
-        throw CommandInvalidException(QPID_MSG("Branch with xid " << xid << " has been completed!"));
+        throw CommandInvalidException(QPID_MSG("Branch with xid " << DtxManager::convert(xid) << " has been completed!"));
     }
     work.push_back(ops);
 }
@@ -133,7 +134,7 @@ bool DtxWorkRecord::check()
         //iterate through all DtxBuffers and ensure they are all ended
         for (Work::iterator i = work.begin(); i != work.end(); i++) {
             if (!(*i)->isEnded()) {
-                throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " not completed!"));
+                throw IllegalStateException(QPID_MSG("Branch with xid " << DtxManager::convert(xid) << " not completed!"));
             } else if ((*i)->isRollbackOnly()) {
                 rolledback = true;
             }

Modified: qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp Wed May  2 13:09:18 2012
@@ -24,6 +24,7 @@
 #include "qpid/broker/FanOutExchange.h"
 #include "qpid/broker/HeadersExchange.h"
 #include "qpid/broker/TopicExchange.h"
+#include "qpid/broker/Link.h"
 #include "qpid/management/ManagementDirectExchange.h"
 #include "qpid/management/ManagementTopicExchange.h"
 #include "qpid/framing/reply_exceptions.h"
@@ -58,6 +59,8 @@ pair<Exchange::shared_ptr, bool> Exchang
             exchange = Exchange::shared_ptr(new ManagementDirectExchange(name, durable, args, parent, broker));
         }else if (type == ManagementTopicExchange::typeName) {
             exchange = Exchange::shared_ptr(new ManagementTopicExchange(name, durable, args, parent, broker));
+        }else if (type == Link::exchangeTypeName) {
+            exchange = Link::linkExchangeFactory(name);
         }else{
             FunctionMap::iterator i =  factory.find(type);
             if (i == factory.end()) {



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


Mime
View raw message