summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qmf/ConsoleSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src/qmf/ConsoleSession.cpp')
-rw-r--r--qpid/cpp/src/qmf/ConsoleSession.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/qpid/cpp/src/qmf/ConsoleSession.cpp b/qpid/cpp/src/qmf/ConsoleSession.cpp
index 6eb9b94bf8..dc2bbe34ee 100644
--- a/qpid/cpp/src/qmf/ConsoleSession.cpp
+++ b/qpid/cpp/src/qmf/ConsoleSession.cpp
@@ -110,9 +110,17 @@ void ConsoleSessionImpl::setAgentFilter(const string& predicate)
enqueueEventLH(eventImpl.release());
}
- if (!connectedBrokerInAgentList && agentQuery.matchesPredicate(connectedBrokerAgent.getAttributes())) {
+ if (!connectedBrokerInAgentList && connectedBrokerAgent.isValid() &&
+ agentQuery.matchesPredicate(connectedBrokerAgent.getAttributes())) {
agents[connectedBrokerAgent.getName()] = connectedBrokerAgent;
connectedBrokerInAgentList = true;
+
+ //
+ // Enqueue a notification of the new agent.
+ //
+ auto_ptr<ConsoleEventImpl> eventImpl(new ConsoleEventImpl(CONSOLE_AGENT_ADD));
+ eventImpl->setAgent(connectedBrokerAgent);
+ enqueueEventLH(ConsoleEvent(eventImpl.release()));
}
}
@@ -393,6 +401,13 @@ void ConsoleSessionImpl::handleAgentUpdate(const string& agentName, const Varian
if (!agentQuery || agentQuery.matchesPredicate(attrs)) {
connectedBrokerInAgentList = true;
agents[agentName] = agent;
+
+ //
+ // Enqueue a notification of the new agent.
+ //
+ auto_ptr<ConsoleEventImpl> eventImpl(new ConsoleEventImpl(CONSOLE_AGENT_ADD));
+ eventImpl->setAgent(agent);
+ enqueueEventLH(ConsoleEvent(eventImpl.release()));
}
return;
}