diff options
author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2011-09-19 15:13:18 +0000 |
---|---|---|
committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2011-09-19 15:13:18 +0000 |
commit | 69ae049561adde6b053c5906d0514c375814cae7 (patch) | |
tree | 11974930517338c66148a246a212c8eb6e00d486 /qpid/cpp/src/qmf/ConsoleSessionImpl.h | |
parent | 2b6022a4eecaf48f44b5a4031d5b9f25b84adb1f (diff) | |
download | qpid-python-69ae049561adde6b053c5906d0514c375814cae7.tar.gz |
QPID-3346: merge in latest from trunk (r1172628)
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3346@1172657 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf/ConsoleSessionImpl.h')
-rw-r--r-- | qpid/cpp/src/qmf/ConsoleSessionImpl.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/qpid/cpp/src/qmf/ConsoleSessionImpl.h b/qpid/cpp/src/qmf/ConsoleSessionImpl.h index 411b3f016a..2f1f631715 100644 --- a/qpid/cpp/src/qmf/ConsoleSessionImpl.h +++ b/qpid/cpp/src/qmf/ConsoleSessionImpl.h @@ -27,6 +27,7 @@ #include "qmf/SchemaId.h" #include "qmf/Schema.h" #include "qmf/ConsoleEventImpl.h" +#include "qmf/EventNotifierImpl.h" #include "qmf/SchemaCache.h" #include "qmf/Query.h" #include "qpid/sys/Mutex.h" @@ -41,9 +42,14 @@ #include "qpid/messaging/Address.h" #include "qpid/management/Buffer.h" #include "qpid/types/Variant.h" + +#include <boost/shared_ptr.hpp> #include <map> #include <queue> +using namespace boost; +using namespace std; + namespace qmf { class ConsoleSessionImpl : public virtual qpid::RefCounted, public qpid::sys::Runnable { public: @@ -56,9 +62,14 @@ namespace qmf { void setDomain(const std::string& d) { domain = d; } void setAgentFilter(const std::string& f); void open(); + void closeAsync(); void close(); bool nextEvent(ConsoleEvent& e, qpid::messaging::Duration t); int pendingEvents() const; + + void setEventNotifier(EventNotifierImpl* notifier); + EventNotifierImpl* getEventNotifier() const; + uint32_t getAgentCount() const; Agent getAgent(uint32_t i) const; Agent getConnectedBrokerAgent() const { return connectedBrokerAgent; } @@ -76,9 +87,11 @@ namespace qmf { uint32_t maxAgentAgeMinutes; bool listenOnDirect; bool strictSecurity; + uint32_t maxThreadWaitTime; Query agentQuery; bool opened; std::queue<ConsoleEvent> eventQueue; + EventNotifierImpl* eventNotifier; qpid::sys::Thread* thread; bool threadCanceled; uint64_t lastVisit; @@ -90,6 +103,8 @@ namespace qmf { std::string directBase; std::string topicBase; boost::shared_ptr<SchemaCache> schemaCache; + qpid::sys::Mutex corrlock; + uint32_t nextCorrelator; void enqueueEvent(const ConsoleEvent&); void enqueueEventLH(const ConsoleEvent&); @@ -99,10 +114,17 @@ namespace qmf { void handleAgentUpdate(const std::string&, const qpid::types::Variant::Map&, const qpid::messaging::Message&); void handleV1SchemaResponse(qpid::management::Buffer&, uint32_t, const qpid::messaging::Message&); void periodicProcessing(uint64_t); + void alertEventNotifierLH(bool readable); void run(); + uint32_t correlator() { qpid::sys::Mutex::ScopedLock l(corrlock); return nextCorrelator++; } friend class AgentImpl; }; + + struct ConsoleSessionImplAccess { + static ConsoleSessionImpl& get(ConsoleSession& session); + static const ConsoleSessionImpl& get(const ConsoleSession& session); + }; } #endif |