diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-07-25 11:54:05 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-07-25 11:54:05 +0200 |
commit | 78aa45dcf75316fc2db511938b7c8249511e54ca (patch) | |
tree | b68cda42fe86a4b868b7e72de55aea4d00dba26b /cpp/src/IceGrid/SessionManager.h | |
parent | Build fixes for MinGW 4.7.2-32 (diff) | |
download | ice-78aa45dcf75316fc2db511938b7c8249511e54ca.tar.bz2 ice-78aa45dcf75316fc2db511938b7c8249511e54ca.tar.xz ice-78aa45dcf75316fc2db511938b7c8249511e54ca.zip |
Improved IceGrid discovery, it now works with icegrid registry slaves and nodes
Diffstat (limited to 'cpp/src/IceGrid/SessionManager.h')
-rw-r--r-- | cpp/src/IceGrid/SessionManager.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/cpp/src/IceGrid/SessionManager.h b/cpp/src/IceGrid/SessionManager.h index e1d3d6e90de..2ff28178032 100644 --- a/cpp/src/IceGrid/SessionManager.h +++ b/cpp/src/IceGrid/SessionManager.h @@ -192,8 +192,8 @@ public: return _state != Destroyed; } - virtual void - tryCreateSession(bool waitForTry = true, const IceUtil::Time& timeout = IceUtil::Time()) + void + tryCreateSession() { { Lock sync(*this); @@ -212,23 +212,24 @@ public: } notifyAll(); } + } - if(waitForTry) + void + waitTryCreateSession(const IceUtil::Time& timeout = IceUtil::Time()) + { + Lock sync(*this); + // Wait until the action is executed and the state changes. + while(_nextAction == Connect || _nextAction == KeepAlive || _state == InProgress) { - Lock sync(*this); - // Wait until the action is executed and the state changes. - while(_nextAction == Connect || _nextAction == KeepAlive || _state == InProgress) + if(timeout == IceUtil::Time()) { - if(timeout == IceUtil::Time()) - { - wait(); - } - else + wait(); + } + else + { + if(!timedWait(timeout)) { - if(!timedWait(timeout)) - { - break; - } + break; } } } @@ -320,16 +321,17 @@ class SessionManager : public IceUtil::Monitor<IceUtil::Mutex> { public: - SessionManager(const Ice::CommunicatorPtr&); + SessionManager(const Ice::CommunicatorPtr&, const std::string&); virtual ~SessionManager(); virtual bool isDestroyed() = 0; protected: - std::vector<IceGrid::QueryPrx> findAllQueryObjects(); + std::vector<IceGrid::QueryPrx> findAllQueryObjects(bool); Ice::CommunicatorPtr _communicator; + std::string _instanceName; InternalRegistryPrx _master; std::vector<IceGrid::QueryPrx> _queryObjects; }; |