qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject svn commit: r1057200 - in /qpid/trunk/qpid/cpp/bindings/qmf2: examples/cpp/agent.cpp examples/python/agent.py python/qmf2.py qmf2.i ruby/qmf2.rb
Date Mon, 10 Jan 2011 14:08:50 GMT
Author: tross
Date: Mon Jan 10 14:08:50 2011
New Revision: 1057200

URL: http://svn.apache.org/viewvc?rev=1057200&view=rev
Log:
Updated Python and Ruby wrappers to reflect API changes.
Updates to the agent examples.

Modified:
    qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/agent.cpp
    qpid/trunk/qpid/cpp/bindings/qmf2/examples/python/agent.py
    qpid/trunk/qpid/cpp/bindings/qmf2/python/qmf2.py
    qpid/trunk/qpid/cpp/bindings/qmf2/qmf2.i
    qpid/trunk/qpid/cpp/bindings/qmf2/ruby/qmf2.rb

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/agent.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/agent.cpp?rev=1057200&r1=1057199&r2=1057200&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/agent.cpp (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/examples/cpp/agent.cpp Mon Jan 10 14:08:50 2011
@@ -60,7 +60,7 @@ ExampleAgent::ExampleAgent(const string&
     //
     // Create and open a messaging connection to a broker.
     //
-    connection = qpid::messaging::Connection(url);
+    connection = qpid::messaging::Connection(url, "{reconnect:True}");
     connection.open();
 
     //
@@ -132,7 +132,7 @@ void ExampleAgent::populateData()
     //
     // Create a control object and give it to the agent session to manage.
     //
-    control = Data(sch_control.getSchemaId());
+    control = Data(sch_control);
     control.setProperty("state", "OPERATIONAL");
     control.setProperty("methodCount", 0);
     controlAddr = session.addData(control, "singleton");
@@ -178,7 +178,7 @@ bool ExampleAgent::method(AgentEvent& ev
             if (event.getArguments()["useString"])
                 session.raiseException(event, event.getArguments()["stringVal"]);
             else {
-                Data ex(sch_exception.getSchemaId());
+                Data ex(sch_exception);
                 ex.setProperty("whatHappened", "It Failed");
                 ex.setProperty("howBad", 75);
                 ex.setProperty("details", event.getArguments()["details"]);

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/examples/python/agent.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/examples/python/agent.py?rev=1057200&r1=1057199&r2=1057200&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/examples/python/agent.py (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/examples/python/agent.py Mon Jan 10 14:08:50 2011
@@ -34,7 +34,7 @@ class ExampleAgent(AgentHandler):
     ##
     ## Create and open a messaging connection to a broker.
     ##
-    self.connection = cqpid.Connection(url)
+    self.connection = cqpid.Connection(url, "{reconnect:True}")
     self.session = None
     self.connection.open()
 
@@ -42,7 +42,6 @@ class ExampleAgent(AgentHandler):
     ## Create, configure, and open a QMFv2 agent session using the connection.
     ##
     self.session = AgentSession(self.connection, "{interval:30}")
-    self.session.setDomain("test")
     self.session.setVendor('profitron.com')
     self.session.setProduct('blastinator')
     self.session.setAttribute('attr1', 1000)

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/python/qmf2.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/python/qmf2.py?rev=1057200&r1=1057199&r2=1057200&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/python/qmf2.py (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/python/qmf2.py Mon Jan 10 14:08:50 2011
@@ -385,10 +385,8 @@ class Data(object):
       self._impl = cqmf2.Data()
     elif arg.__class__ == cqmf2.Data:
       self._impl = arg
-    elif arg.__class__ == SchemaId:
-      self._impl = cqmf2.Data(arg._impl)
     elif arg.__class__ == Schema:
-      self._impl = cqmf2.Data(arg.getSchemaId()._impl)
+      self._impl = cqmf2.Data(arg._impl)
     else:
       raise Exception("Unsupported initializer for Data")
     self._schema = None
@@ -444,6 +442,7 @@ class Data(object):
     ## validate that we have the right number of arguments supplied, and marshall them
     ## into a map for transmission.
     ##
+    arglist = []
     methods = self._schema.getMethods()
     for m in methods:
       if m.getName() == name:
@@ -683,6 +682,11 @@ class SchemaProperty(object):
     """
     return self._impl.getName()
 
+  def getType(self):
+    """
+    """
+    return self._impl.getType()
+
   def getAccess(self):
     """
     """

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/qmf2.i
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/qmf2.i?rev=1057200&r1=1057199&r2=1057200&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/qmf2.i (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/qmf2.i Mon Jan 10 14:08:50 2011
@@ -33,6 +33,7 @@
 #include <qmf/SchemaMethod.h>
 #include <qmf/SchemaProperty.h>
 #include <qmf/SchemaTypes.h>
+#include <qmf/Subscription.h>
 
 %}
 
@@ -54,6 +55,7 @@
 %include <qmf/SchemaMethod.h>
 %include <qmf/SchemaProperty.h>
 %include <qmf/SchemaTypes.h>
+%include <qmf/Subscription.h>
 
 %{
 

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/ruby/qmf2.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/ruby/qmf2.rb?rev=1057200&r1=1057199&r2=1057200&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/ruby/qmf2.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/ruby/qmf2.rb Mon Jan 10 14:08:50 2011
@@ -250,10 +250,8 @@ module Qmf2
         @impl = Cqmf2::Data.new
       elsif arg.class == Cqmf2::Data
         @impl = arg
-      elsif arg.class == SchemaId
-        @impl = Cqmf2::Data(arg.impl)
       elsif arg.class == Schema
-        @impl = Cqmf2::Data(arg.impl.getSchemaId)
+        @impl = Cqmf2::Data(arg.impl)
       else
         raise "Unsupported initializer for Data"
       end



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message