summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ObjectAdapterI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-09-30 04:58:01 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-09-30 04:58:01 +0000
commita795900d002f4182b13b32f6ebf3391458786123 (patch)
tree3a75ed09a7ce57e0253f54ee6f0cbcf08dfba3ac /cpp/src/Ice/ObjectAdapterI.cpp
parentBug 498. (diff)
downloadice-a795900d002f4182b13b32f6ebf3391458786123.tar.bz2
ice-a795900d002f4182b13b32f6ebf3391458786123.tar.xz
ice-a795900d002f4182b13b32f6ebf3391458786123.zip
Added support for <adapter name>.ReplicaId.
Diffstat (limited to 'cpp/src/Ice/ObjectAdapterI.cpp')
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index 32d6157771c..be2e6375575 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -64,6 +64,7 @@ Ice::ObjectAdapterI::activate()
LocatorRegistryPrx locatorRegistry;
bool registerProcess = false;
string serverId;
+ string replicaId;
CommunicatorPtr communicator;
bool printAdapterReady = false;
@@ -81,6 +82,7 @@ Ice::ObjectAdapterI::activate()
registerProcess = _instance->properties()->getPropertyAsInt(_name + ".RegisterProcess") > 0;
serverId = _instance->properties()->getProperty("Ice.ServerId");
+ replicaId = _instance->properties()->getPropertyWithDefault(_name + ".ReplicaId", serverId);
printAdapterReady = _instance->properties()->getPropertyAsInt("Ice.PrintAdapterReady") > 0;
if(registerProcess && !locatorRegistry)
@@ -120,24 +122,17 @@ Ice::ObjectAdapterI::activate()
{
Identity ident;
ident.name = "dummy";
- locatorRegistry->setAdapterDirectProxy(serverId, _id, createDirectProxy(ident));
+ locatorRegistry->setAdapterDirectProxy(_id, replicaId, createDirectProxy(ident));
}
catch(const ObjectAdapterDeactivatedException&)
{
// IGNORE: The object adapter is already inactive.
}
- catch(const ServerNotFoundException&)
- {
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "server";
- ex.id = serverId;
- throw ex;
- }
- catch(const AdapterNotFoundException&)
+ catch(const AdapterNotFoundException& e)
{
NotRegisteredException ex(__FILE__, __LINE__);
ex.kindOfObject = "object adapter";
- ex.id = _id;
+ ex.id = e.replica ? _id + " (replica = " + replicaId + ")" : _id;
throw ex;
}
catch(const AdapterAlreadyActiveException&)