diff options
Diffstat (limited to 'cpp/src/qmf/ConsoleSessionImpl.h')
-rw-r--r-- | cpp/src/qmf/ConsoleSessionImpl.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/src/qmf/ConsoleSessionImpl.h b/cpp/src/qmf/ConsoleSessionImpl.h index 675c8bcfb5..e2b30602fa 100644 --- a/cpp/src/qmf/ConsoleSessionImpl.h +++ b/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,13 @@ #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 std; + namespace qmf { class ConsoleSessionImpl : public virtual qpid::RefCounted, public qpid::sys::Runnable { public: @@ -56,8 +61,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; } @@ -75,9 +86,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; @@ -89,6 +102,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&); @@ -98,10 +113,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 |