diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-01-30 16:51:24 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-01-30 16:51:24 +0100 |
commit | 6f99bac58a16e55487b98ddb5d6f837574c55b02 (patch) | |
tree | 20db5f71eeee5c7eb0796aed44a150206dff14b0 /cpp/src/IceGrid/ServerAdapterI.cpp | |
parent | ICE-4775 - memory leak in Glacier2 (diff) | |
download | ice-6f99bac58a16e55487b98ddb5d6f837574c55b02.tar.bz2 ice-6f99bac58a16e55487b98ddb5d6f837574c55b02.tar.xz ice-6f99bac58a16e55487b98ddb5d6f837574c55b02.zip |
Fixed ICE-4772, IceGrid server disable patch for Cengage
Diffstat (limited to 'cpp/src/IceGrid/ServerAdapterI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerAdapterI.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/ServerAdapterI.cpp b/cpp/src/IceGrid/ServerAdapterI.cpp index 814a2f283e2..4c4122ac2ca 100644 --- a/cpp/src/IceGrid/ServerAdapterI.cpp +++ b/cpp/src/IceGrid/ServerAdapterI.cpp @@ -20,12 +20,14 @@ ServerAdapterI::ServerAdapterI(const NodeIPtr& node, ServerI* server, const string& serverName, const AdapterPrx& proxy, - const string& id) : + const string& id, + bool enabled) : _node(node), _this(proxy), _serverId(serverName), _id(id), - _server(server) + _server(server), + _enabled(enabled) { } @@ -39,7 +41,7 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur { { Lock sync(*this); - if(_proxy) + if(_enabled && _proxy) { // // Return the adapter direct proxy. @@ -53,7 +55,7 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur // Nothing else waits for this adapter so we must make sure that this // adapter if still activatable. // - if(!_server->isAdapterActivatable(_id)) + if(!_enabled || !_server->isAdapterActivatable(_id)) { cb->ice_response(0); return; @@ -113,14 +115,14 @@ ServerAdapterI::getDirectProxy(const Ice::Current& current) const // Return the adapter direct proxy if it's set. Otherwise, throw. The caller can eventually // activate the adapter if it's activatable. // - if(_proxy) + if(_proxy && _enabled) { return _proxy; } else { AdapterNotActiveException ex; - ex.activatable = _server->isAdapterActivatable(_id); + ex.activatable = _enabled && _server->isAdapterActivatable(_id); throw ex; } } @@ -206,6 +208,13 @@ ServerAdapterI::destroy() } void +ServerAdapterI::updateEnabled() +{ + Lock sync(*this); + _enabled = _server->isEnabled(); +} + +void ServerAdapterI::clear() { Lock sync(*this); |