summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-01-20 09:54:58 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-01-20 09:54:58 +0000
commitdb6052fed7c910983a4b5d046ca6e5571071a5a0 (patch)
tree9cab5ecea61a50534b86f1b5ac0d2759fc692678 /cpp/src
parentno need to shutdown socket after sending close connection (diff)
downloadice-db6052fed7c910983a4b5d046ca6e5571071a5a0.tar.bz2
ice-db6052fed7c910983a4b5d046ca6e5571071a5a0.tar.xz
ice-db6052fed7c910983a4b5d046ca6e5571071a5a0.zip
:changeLocator()
:activate() which could cause it to raise ObjectAdapterDeactivatedException if the adapter was deactivated concurrently.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp43
-rw-r--r--cpp/src/Ice/Reference.cpp3
2 files changed, 25 insertions, 21 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index 9151d0b33fd..790a2d33cea 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -119,16 +119,20 @@ Ice::ObjectAdapterI::activate()
{
Identity ident;
ident.name = "dummy";
- locatorRegistry->setAdapterDirectProxy(_id, newDirectProxy(ident, ""));
+ locatorRegistry->setAdapterDirectProxy(_id, createDirectProxy(ident));
}
- catch(const Ice::AdapterNotFoundException&)
+ catch(const ObjectAdapterDeactivatedException&)
+ {
+ // IGNORE: The object adapter is already inactive.
+ }
+ catch(const AdapterNotFoundException&)
{
NotRegisteredException ex(__FILE__, __LINE__);
ex.kindOfObject = "object adapter";
ex.id = _id;
throw ex;
}
- catch(const Ice::AdapterAlreadyActiveException&)
+ catch(const AdapterAlreadyActiveException&)
{
ObjectAdapterIdInUseException ex(__FILE__, __LINE__);
ex.id = _id;
@@ -137,21 +141,24 @@ Ice::ObjectAdapterI::activate()
if(registerProcess)
{
- ProcessPtr servant = new ProcessI(communicator);
- ProcessPrx proxy = ProcessPrx::uncheckedCast(addWithUUID(servant));
-
- try
- {
- locatorRegistry->setServerProcessProxy(serverId, proxy);
- }
- catch(const ServerNotFoundException&)
- {
- NotRegisteredException ex(__FILE__, __LINE__);
- ex.kindOfObject = "server";
- ex.id = serverId;
- throw ex;
- }
- }
+ try
+ {
+ ProcessPtr servant = new ProcessI(communicator);
+ ProcessPrx proxy = ProcessPrx::uncheckedCast(addWithUUID(servant));
+ locatorRegistry->setServerProcessProxy(serverId, proxy);
+ }
+ 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;
+ }
+ }
}
if(printAdapterReady)
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index 3c77087b837..392aed1d0e6 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -922,10 +922,7 @@ IceInternal::IndirectReference::getEndpoints() const
ReferencePtr
IceInternal::IndirectReference::changeLocator(const LocatorPrx& newLocator) const
{
- assert(newLocator);
-
LocatorInfoPtr newLocatorInfo = getInstance()->locatorManager()->get(newLocator);
-
if(newLocatorInfo == _locatorInfo)
{
return IndirectReferencePtr(const_cast<IndirectReference*>(this));