diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-09-08 12:03:16 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-09-08 12:03:16 -0400 |
commit | a0f6b6fc1a619c40979f5ba00d71dc661cfc6499 (patch) | |
tree | 81b40da86417ed18a186d595c119bb7823b17fcf /cpp/src/Ice/ObjectAdapterI.cpp | |
parent | ICE-5658 - NPM support for IceJS distribution (diff) | |
download | ice-a0f6b6fc1a619c40979f5ba00d71dc661cfc6499.tar.bz2 ice-a0f6b6fc1a619c40979f5ba00d71dc661cfc6499.tar.xz ice-a0f6b6fc1a619c40979f5ba00d71dc661cfc6499.zip |
Fixed ICE-5667: Added Communicator::createAdmin in C++, Java, C# and Python
Diffstat (limited to 'cpp/src/Ice/ObjectAdapterI.cpp')
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 33b275bd616..a2ffa037994 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -48,7 +48,7 @@ namespace { inline void checkIdentity(const Identity& ident) { - if(ident.name.size() == 0) + if(ident.name.empty()) { throw IllegalIdentityException(__FILE__, __LINE__, ident); } @@ -56,7 +56,7 @@ inline void checkIdentity(const Identity& ident) inline void checkServant(const ObjectPtr& servant) { - if(servant == 0) + if(!servant) { throw IllegalServantException(__FILE__, __LINE__, "cannot add null servant to Object Adapter"); } @@ -640,6 +640,22 @@ Ice::ObjectAdapterI::setLocator(const LocatorPrx& locator) _locatorInfo = _instance->locatorManager()->get(locator); } +LocatorPrx +Ice::ObjectAdapterI::getLocator() const +{ + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); + + if(!_locatorInfo) + { + return 0; + } + else + { + return _locatorInfo->getLocator(); + } +} + + void Ice::ObjectAdapterI::refreshPublishedEndpoints() { |