diff options
Diffstat (limited to 'cpp/src/IceGrid/NodeI.h')
-rw-r--r-- | cpp/src/IceGrid/NodeI.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/NodeI.h b/cpp/src/IceGrid/NodeI.h index 36ac0019c0e..46c6470bb83 100644 --- a/cpp/src/IceGrid/NodeI.h +++ b/cpp/src/IceGrid/NodeI.h @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -35,9 +35,29 @@ typedef IceUtil::Handle<ServerCommand> ServerCommandPtr; class NodeSessionManager; +class NodeI; +typedef IceUtil::Handle<NodeI> NodeIPtr; + class NodeI : public Node, public IceUtil::Monitor<IceUtil::Mutex> { public: + class Update : virtual public IceUtil::Shared + { + public: + + Update(const NodeIPtr&, const NodeObserverPrx&); + virtual ~Update(); + + virtual bool send() = 0; + + void finished(bool); + + protected: + + const NodeIPtr _node; + const NodeObserverPrx _observer; + }; + typedef IceUtil::Handle<Update> UpdatePtr; NodeI(const Ice::ObjectAdapterPtr&, NodeSessionManager&, const ActivatorPtr&, const IceUtil::TimerPtr&, const TraceLevelsPtr&, const NodePrx&, const std::string&, const UserAccountMapperPrx&); @@ -72,7 +92,7 @@ public: virtual Ice::Long getOffsetFromEnd(const std::string&, int, const Ice::Current&) const; virtual bool read(const std::string&, Ice::Long, int, Ice::Long&, Ice::StringSeq&, const Ice::Current&) const; - void destroy(); + void shutdown(); IceUtil::TimerPtr getTimer() const; Ice::CommunicatorPtr getCommunicator() const; @@ -97,6 +117,8 @@ public: void removeObserver(const NodeSessionPrx&); void observerUpdateServer(const ServerDynamicInfo&); void observerUpdateAdapter(const AdapterDynamicInfo&); + void queueUpdate(const NodeObserverPrx&, const UpdatePtr&); + void dequeueUpdate(const NodeObserverPrx&, const UpdatePtr&, bool); void addServer(const ServerIPtr&, const std::string&); void removeServer(const ServerIPtr&, const std::string&); @@ -143,6 +165,8 @@ private: std::map<std::string, ServerDynamicInfo> _serversDynamicInfo; std::map<std::string, AdapterDynamicInfo> _adaptersDynamicInfo; + std::map<NodeObserverPrx, std::deque<UpdatePtr> > _observerUpdates; + IceUtil::Mutex _serversLock; std::map<std::string, std::set<ServerIPtr> > _serversByApplication; std::set<std::string> _patchInProgress; |