You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ns...@apache.org on 2008/05/13 22:36:23 UTC
svn commit: r656004 - in /incubator/qpid/trunk/qpid/python:
qpid/management.py qpid/managementdata.py tests_0-10/management.py
Author: nsantos
Date: Tue May 13 13:36:23 2008
New Revision: 656004
URL: http://svn.apache.org/viewvc?rev=656004&view=rev
Log:
continuation of QPID-1052
Modified:
incubator/qpid/trunk/qpid/python/qpid/management.py
incubator/qpid/trunk/qpid/python/qpid/managementdata.py
incubator/qpid/trunk/qpid/python/tests_0-10/management.py
Modified: incubator/qpid/trunk/qpid/python/qpid/management.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/management.py?rev=656004&r1=656003&r2=656004&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/management.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/management.py Tue May 13 13:36:23 2008
@@ -78,6 +78,13 @@
for arg in args:
setattr (self, arg, args[arg])
+class brokerInfo:
+ """ Object that contains information about a broker and the session to it """
+
+ def __init__ (self, brokerId, sessionId):
+ self.brokerId = brokerId
+ self.sessionId = sessionId
+
class managementChannel:
""" This class represents a connection to an AMQP broker. """
@@ -137,7 +144,7 @@
def exceptionCb (self, data):
if self.ecb != None:
- self.ecb (data)
+ self.ecb (self, data)
def send (self, exchange, msg):
if self.enabled:
@@ -323,9 +330,9 @@
self.parse (ch, codec, hdr[0], hdr[1])
ch.accept(msg)
- def exceptCb (self, data):
+ def exceptCb (self, ch, data):
if self.closeCb != None:
- self.closeCb (data)
+ self.closeCb (ch.context, data)
#========================================================
# Internal Functions
@@ -498,10 +505,9 @@
def handleBrokerResponse (self, ch, codec):
uuid = codec.read_uuid ()
- data = (uuid, ch.sessionId)
- ch.setBrokerInfo (data)
+ ch.brokerInfo = brokerInfo (uuid, ch.sessionId)
if self.ctrlCb != None:
- self.ctrlCb (ch.context, self.CTRL_BROKER_INFO, data)
+ self.ctrlCb (ch.context, self.CTRL_BROKER_INFO, ch.brokerInfo)
# Send a package request
sendCodec = Codec (self.spec)
Modified: incubator/qpid/trunk/qpid/python/qpid/managementdata.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/managementdata.py?rev=656004&r1=656003&r2=656004&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/managementdata.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/managementdata.py Tue May 13 13:36:23 2008
@@ -160,7 +160,7 @@
finally:
self.lock.release ()
- def closeHandler (self, reason):
+ def closeHandler (self, context, reason):
print "Connection to broker lost:", reason
self.operational = False
if self.cli != None:
Modified: incubator/qpid/trunk/qpid/python/tests_0-10/management.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/tests_0-10/management.py?rev=656004&r1=656003&r2=656004&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/tests_0-10/management.py (original)
+++ incubator/qpid/trunk/qpid/python/tests_0-10/management.py Tue May 13 13:36:23 2008
@@ -73,7 +73,7 @@
brokerSessions = mc.syncGetObjects (mch, "session")
found = False
for bs in brokerSessions:
- if bs.name == info[1]:
+ if bs.name == info.sessionId:
found = True
self.assertEqual (found, True)
mc.removeChannel (mch)