summaryrefslogtreecommitdiff
path: root/cpp/examples
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-05-04 21:44:59 +0000
committerStephen D. Huston <shuston@apache.org>2009-05-04 21:44:59 +0000
commitabdf1ec27a07d5067e185e970c8229e06df28823 (patch)
tree50886fef8a3cc5e64c5299d7a09707c2d7ad227c /cpp/examples
parent3c20c531712c067b040320d2fc48af915c8de112 (diff)
downloadqpid-python-abdf1ec27a07d5067e185e970c8229e06df28823.tar.gz
Add portability support for QMF agent, thanks to Pete McKinnon - partially fixes QPID-1731
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@771457 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples')
-rw-r--r--cpp/examples/README14
-rw-r--r--cpp/examples/qmf-agent/example.cpp6
2 files changed, 17 insertions, 3 deletions
diff --git a/cpp/examples/README b/cpp/examples/README
index 50f0c07089..7bf35b53de 100644
--- a/cpp/examples/README
+++ b/cpp/examples/README
@@ -111,4 +111,16 @@ On Linux:
# ./server
# ./client
-
+== QMF Agent ==
+
+This example demonstrates integration with the Qpid Management Framework (QMF).
+After launching a Qpid broker, the sample program will connect to it and
+advertise a managed object (org.apache.qpid.agent.example:parent). Using
+qpid-tool, you can monitor the object and also call a method (create_child) to
+spawn managed child objects.
+
+To build this example, simply invoke make on Unix or Linux. On Windows, you
+must invoke
+ nmake /f example_gen.mak
+before building the sample to generate the supporting model classes
+(e.g., Parent,Child,etc.).
diff --git a/cpp/examples/qmf-agent/example.cpp b/cpp/examples/qmf-agent/example.cpp
index 4dec014370..a611c25ba3 100644
--- a/cpp/examples/qmf-agent/example.cpp
+++ b/cpp/examples/qmf-agent/example.cpp
@@ -23,6 +23,7 @@
#include <qpid/management/ManagementObject.h>
#include <qpid/agent/ManagementAgent.h>
#include <qpid/sys/Mutex.h>
+#include <qpid/sys/Time.h>
#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"
@@ -30,7 +31,6 @@
#include "qmf/org/apache/qpid/agent/example/Package.h"
#include <signal.h>
-#include <unistd.h>
#include <cstdlib>
#include <iostream>
@@ -102,7 +102,7 @@ void CoreClass::doLoop()
{
// Periodically bump a counter to provide a changing statistical value
while (1) {
- sleep(1);
+ qpid::sys::sleep(1);
mgmtObject->inc_count();
mgmtObject->set_state("IN_LOOP");
@@ -187,6 +187,8 @@ int main_int(int argc, char** argv)
CoreClass core3(agent, "Example Core Object #3");
core1.doLoop();
+
+ return 0;
}
int main(int argc, char** argv)