summaryrefslogtreecommitdiff
path: root/cpp/examples/qmf-agent/example.cpp
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2010-04-14 18:57:18 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2010-04-14 18:57:18 +0000
commit3edf82281ced8fed78945878f771707ab4eaeddf (patch)
tree2b64827a765fdc3e4efbfbdbc18cf39460192a6a /cpp/examples/qmf-agent/example.cpp
parent8da1c5c7cf140957e95971ae4bb7e31647184a41 (diff)
downloadqpid-python-3edf82281ced8fed78945878f771707ab4eaeddf.tar.gz
QPID-2506: enable map and list method arguments.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@934117 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/qmf-agent/example.cpp')
-rw-r--r--cpp/examples/qmf-agent/example.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/cpp/examples/qmf-agent/example.cpp b/cpp/examples/qmf-agent/example.cpp
index 18f1bf6a90..b432c2a065 100644
--- a/cpp/examples/qmf-agent/example.cpp
+++ b/cpp/examples/qmf-agent/example.cpp
@@ -28,6 +28,7 @@
#include "qmf/org/apache/qpid/agent/example/Parent.h"
#include "qmf/org/apache/qpid/agent/example/Child.h"
#include "qmf/org/apache/qpid/agent/example/ArgsParentCreate_child.h"
+#include "qmf/org/apache/qpid/agent/example/ArgsParentTest_method.h"
#include "qmf/org/apache/qpid/agent/example/EventChildCreated.h"
#include "qmf/org/apache/qpid/agent/example/Package.h"
@@ -141,7 +142,7 @@ Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args,
Mutex::ScopedLock _lock(vectorLock);
switch (methodId) {
- case _qmf::Parent::METHOD_CREATE_CHILD:
+ case _qmf::Parent::METHOD_CREATE_CHILD: {
_qmf::ArgsParentCreate_child& ioArgs = (_qmf::ArgsParentCreate_child&) args;
ChildClass *child = new ChildClass(agent, this, ioArgs.i_name);
@@ -154,6 +155,16 @@ Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args,
return STATUS_OK;
}
+ case _qmf::Parent::METHOD_TEST_METHOD: {
+ _qmf::ArgsParentTest_method& ioArgs = (_qmf::ArgsParentTest_method&) args;
+
+ ioArgs.io_aMap["add"] = "me";
+ ioArgs.io_aList.push_back(Variant("Stuff"));
+ // TBD
+ return STATUS_OK;
+ }
+ }
+
return STATUS_NOT_IMPLEMENTED;
}
@@ -181,10 +192,6 @@ int main_int(int argc, char** argv)
singleton = new ManagementAgent::Singleton();
const char* host = argc>1 ? argv[1] : "127.0.0.1";
int port = argc>2 ? atoi(argv[2]) : 5672;
- qpid::client::ConnectionSettings settings;
-
- settings.host = host;
- settings.port = port;
signal(SIGINT, shutdown);
@@ -199,7 +206,7 @@ int main_int(int argc, char** argv)
// Start the agent. It will attempt to make a connection to the
// management broker
- agent->init(settings, 5, false, ".magentdata");
+ agent->init(host, port, 5, false, ".magentdata");
// Allocate some core objects
CoreClass core1(agent, "Example Core Object #1");