summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/ServerI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-10-20 14:11:37 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-10-20 14:11:37 +0000
commit12d2c541faa3f6a4db3ba58e7f9c8f9c03f947e8 (patch)
tree342dbb435f37e4f64fd1c515fc14fa17cf0e4639 /cpp/src/IceGrid/ServerI.cpp
parentFix (diff)
downloadice-12d2c541faa3f6a4db3ba58e7f9c8f9c03f947e8.tar.bz2
ice-12d2c541faa3f6a4db3ba58e7f9c8f9c03f947e8.tar.xz
ice-12d2c541faa3f6a4db3ba58e7f9c8f9c03f947e8.zip
Observer fixes
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r--cpp/src/IceGrid/ServerI.cpp42
1 files changed, 7 insertions, 35 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp
index c64bdf1e3ba..131a6c8bf09 100644
--- a/cpp/src/IceGrid/ServerI.cpp
+++ b/cpp/src/IceGrid/ServerI.cpp
@@ -720,6 +720,8 @@ ServerI::setEnabled(bool enabled, const ::Ice::Current&)
{
return; // Nothing to change!
}
+
+ _node->observerUpdateServer(getDynamicInfo());
}
if(activate)
@@ -738,19 +740,6 @@ ServerI::setEnabled(bool enabled, const ::Ice::Current&)
{
}
}
-
- NodeObserverPrx observer = _node->getObserver();
- if(observer)
- {
- try
- {
- observer->updateServer(_node->getName(), getDynamicInfo());
- }
- catch(const Ice::LocalException&)
- {
- // Expected if the IceGrid registry is down.
- }
- }
}
bool
@@ -1509,10 +1498,7 @@ ServerI::destroy()
adpts = _adapters;
}
- if(_info.descriptor->applicationDistrib)
- {
- _node->removeServer(_info.application, this);
- }
+ _node->removeServer(this, _info.application, _info.descriptor->applicationDistrib);
try
{
@@ -1688,14 +1674,11 @@ ServerI::update()
throw DeploymentException(msg);
}
- if(oldInfo.descriptor && oldInfo.descriptor->applicationDistrib)
- {
- _node->removeServer(oldInfo.application, this);
- }
- if(_info.descriptor->applicationDistrib)
+ if(oldInfo.descriptor)
{
- _node->addServer(_info.application, this);
+ _node->removeServer(this, oldInfo.application, oldInfo.descriptor->applicationDistrib);
}
+ _node->addServer(this, _info.application, _info.descriptor->applicationDistrib);
AdapterPrxDict adapters;
for(ServerAdapterDict::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
@@ -2329,18 +2312,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason)
if(toServerState(previous) != toServerState(_state) &&
!(previous == Inactive && _state == Deactivating))
{
- NodeObserverPrx observer = _node->getObserver();
- if(observer)
- {
- try
- {
- observer->updateServer(_node->getName(), getDynamicInfo());
- }
- catch(const Ice::LocalException&)
- {
- // Expected if the IceGrid registry is down.
- }
- }
+ _node->observerUpdateServer(getDynamicInfo());
}
if(_node->getTraceLevels()->server > 1)