summaryrefslogtreecommitdiff
path: root/cpp/examples/qmf-agent/example.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-07-16 20:25:12 +0000
committerTed Ross <tross@apache.org>2008-07-16 20:25:12 +0000
commit0742abc5e6831675aba58949d763fb4f819cde69 (patch)
tree806d768e89b6fec8d301396ec889a12f6c9e33e1 /cpp/examples/qmf-agent/example.cpp
parent1848880ade63a0d2e2e9472a3fc231c52962dd78 (diff)
downloadqpid-python-0742abc5e6831675aba58949d763fb4f819cde69.tar.gz
QPID-1170 - Provide a better factory for creation and deletion of the management agent
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@677408 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/qmf-agent/example.cpp')
-rw-r--r--cpp/examples/qmf-agent/example.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/examples/qmf-agent/example.cpp b/cpp/examples/qmf-agent/example.cpp
index 4113d22cac..7b28595f14 100644
--- a/cpp/examples/qmf-agent/example.cpp
+++ b/cpp/examples/qmf-agent/example.cpp
@@ -68,11 +68,12 @@ CoreClass::CoreClass(ManagementAgent* agent, string _name) : name(_name)
// Main program
//==============================================================
int main(int argc, char** argv) {
+ ManagementAgent::Singleton singleton;
const char* host = argc>1 ? argv[1] : "127.0.0.1";
int port = argc>2 ? atoi(argv[2]) : 5672;
// Create the qmf management agent
- ManagementAgent* agent = new ManagementAgentImpl();
+ ManagementAgent* agent = singleton.getInstance();
// Register the Qmf_example schema with the agent
PackageQmf_example packageInit(agent);