diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-09-05 15:03:32 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-09-05 15:03:32 +0000 |
commit | cca8b5bbd5d854c69dbea17968432067ba96e21f (patch) | |
tree | 368c495a49f182121e7fc722579a23207cd3ac05 /cpp/src/IceGrid/NodeCache.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=403 (diff) | |
download | ice-cca8b5bbd5d854c69dbea17968432067ba96e21f.tar.bz2 ice-cca8b5bbd5d854c69dbea17968432067ba96e21f.tar.xz ice-cca8b5bbd5d854c69dbea17968432067ba96e21f.zip |
Added support for adaptive load balancing.
Diffstat (limited to 'cpp/src/IceGrid/NodeCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeCache.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index 2c421a641c5..7cea0b2d9da 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -16,6 +16,11 @@ using namespace std; using namespace IceGrid; +NodeCache::NodeCache(int sessionTimeout, const TraceLevelsPtr& traceLevels) : + CacheByString<NodeEntry>(traceLevels), _sessionTimeout(sessionTimeout) +{ +} + NodeEntryPtr NodeCache::get(const string& name, bool create) const { @@ -114,6 +119,17 @@ NodeEntry::getServers() const return names; } +LoadInfo +NodeEntry::getLoadInfo() const +{ + Lock sync(*this); + if(!_session) + { + throw NodeUnreachableException(); + } + return _session->getLoadInfo(); +} + bool NodeEntry::canRemove() { |