summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/ServerI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-11-23 11:25:31 +0100
committerBenoit Foucher <benoit@zeroc.com>2007-11-23 11:25:31 +0100
commit183c7a004d0a62ddecd9eeb0bc459846d98a7614 (patch)
tree32f237ef7da3bb59647a97cc6bf036afb45266a3 /cpp/src/IceGrid/ServerI.cpp
parentFixed couple of issues with SL distributions (diff)
downloadice-183c7a004d0a62ddecd9eeb0bc459846d98a7614.tar.bz2
ice-183c7a004d0a62ddecd9eeb0bc459846d98a7614.tar.xz
ice-183c7a004d0a62ddecd9eeb0bc459846d98a7614.zip
Refactored IceGrid session servant management
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r--cpp/src/IceGrid/ServerI.cpp79
1 files changed, 10 insertions, 69 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp
index da784d219e2..71315d1a6c4 100644
--- a/cpp/src/IceGrid/ServerI.cpp
+++ b/cpp/src/IceGrid/ServerI.cpp
@@ -742,82 +742,23 @@ ServerI::getPid(const Ice::Current&) const
return _node->getActivator()->getServerPid(_id);
}
-Ice::PropertyDict
-ServerI::getProperties(const Ice::Current&) const
-{
- Ice::ProcessPrx process = 0;
- {
- Lock sync(*this);
-
- //
- // Wait for _process to be set if the server is being activated.
- //
- while(_desc->processRegistered && _process == 0 && _state > Inactive && _state < Deactivating)
- {
- wait();
- }
-
- checkDestroyed();
- if(!_process)
- {
- if(_desc->processRegistered && _state == Inactive)
- {
- throw ServerUnreachableException(_id, "server is not active");
- }
- else if(_desc->processRegistered && _state >= Deactivating)
- {
- throw ServerUnreachableException(_id, "server is deactivating");
- }
- else
- {
- throw ServerUnreachableException(_id, "no Admin object");
- }
- }
-
- process = _process;
- }
-
- try
- {
- return Ice::PropertiesAdminPrx::uncheckedCast(process, "Properties")->getPropertiesForPrefix("");
- }
- catch(const Ice::FacetNotExistException&)
- {
- //
- // Probably an old server
- //
- throw ServerUnreachableException(_id, "no Properties facet");
- }
- catch(const Ice::ObjectNotExistException&)
- {
- //
- // Looks like the server was shut down
- //
- throw ServerUnreachableException(_id, "no Admin object");
- }
- catch(const Ice::LocalException& ex)
- {
- throw ServerUnreachableException(_id, ex.what());
- }
-}
-
Ice::ObjectPrx
ServerI::getRealAdmin() const
{
Lock sync(*this);
-
- if(_state <= Inactive || _state >= Deactivating)
- {
- return 0;
- }
//
- // Wait for _process to be set if the server is being activated.
+ // Don't wait for the process activation to avoid blocking the thread. The
+ // caller should ensure that the server is active before invoking server
+ // admin objects instead. He can do that by calling Admin::startServer().
//
- while(_desc->processRegistered && _process == 0 && _state > Inactive && _state < Deactivating)
- {
- wait();
- }
+// //
+// // Wait for _process to be set if the server is being activated.
+// //
+// while(_desc->processRegistered && _process == 0 && _state > Inactive && _state < Deactivating)
+// {
+// wait();
+// }
if(_process == 0 || _state <= Inactive || _state >= Deactivating)
{