diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/ObjectAdapterFactory.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterFactory.h | 4 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 22 |
3 files changed, 27 insertions, 11 deletions
diff --git a/cpp/src/Ice/ObjectAdapterFactory.cpp b/cpp/src/Ice/ObjectAdapterFactory.cpp index e61834a856f..c2fec862545 100644 --- a/cpp/src/Ice/ObjectAdapterFactory.cpp +++ b/cpp/src/Ice/ObjectAdapterFactory.cpp @@ -25,7 +25,7 @@ IceInternal::ObjectAdapterFactory::shutdown() map<string, ObjectAdapterIPtr> adapters; { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // // Ignore shutdown requests if the object adapter factory has @@ -56,7 +56,7 @@ void IceInternal::ObjectAdapterFactory::waitForShutdown() { { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // // First we wait for the shutdown of the factory itself. @@ -89,7 +89,7 @@ IceInternal::ObjectAdapterFactory::waitForShutdown() _adapters.clear(); { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); // // Signal that waiting is complete. @@ -102,7 +102,7 @@ IceInternal::ObjectAdapterFactory::waitForShutdown() ObjectAdapterPtr IceInternal::ObjectAdapterFactory::createObjectAdapter(const string& name, const string& endpoints) { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); if(!_instance) { @@ -123,7 +123,7 @@ IceInternal::ObjectAdapterFactory::createObjectAdapter(const string& name, const ObjectAdapterPtr IceInternal::ObjectAdapterFactory::findObjectAdapter(const ObjectPrx& proxy) { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); if(!_instance) { @@ -165,7 +165,7 @@ IceInternal::ObjectAdapterFactory::flushBatchRequests() const { list<ObjectAdapterIPtr> a; { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); for(map<string, ObjectAdapterIPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) { diff --git a/cpp/src/Ice/ObjectAdapterFactory.h b/cpp/src/Ice/ObjectAdapterFactory.h index 18c419cab6f..2524ae8eeb8 100644 --- a/cpp/src/Ice/ObjectAdapterFactory.h +++ b/cpp/src/Ice/ObjectAdapterFactory.h @@ -11,13 +11,13 @@ #define ICE_OBJECT_ADAPTER_FACTORY_H #include <Ice/ObjectAdapterI.h> -#include <IceUtil/Mutex.h> +#include <IceUtil/RecMutex.h> #include <IceUtil/Monitor.h> namespace IceInternal { -class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::Monitor< ::IceUtil::Mutex> +class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::Monitor< ::IceUtil::RecMutex> { public: diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 7ac0173684b..ccd18813798 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -552,11 +552,11 @@ bool Ice::ObjectAdapterI::isLocal(const ObjectPrx& proxy) const { IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - checkForDeactivation(); ReferencePtr ref = proxy->__reference(); vector<EndpointIPtr>::const_iterator p; + vector<EndpointIPtr> endpoints; IndirectReferencePtr ir = IndirectReferencePtr::dynamicCast(ref); if(ir) @@ -569,7 +569,24 @@ Ice::ObjectAdapterI::isLocal(const ObjectPrx& proxy) const // return ir->getAdapterId() == _id; } - return false; + + // + // Get Locator endpoint information for indirect references. + // + LocatorInfoPtr info = ir->getLocatorInfo(); + if(info) + { + bool isCached; + endpoints = info->getEndpoints(ir, isCached); + } + else + { + return false; + } + } + else + { + endpoints = ref->getEndpoints(); } // @@ -577,7 +594,6 @@ Ice::ObjectAdapterI::isLocal(const ObjectPrx& proxy) const // endpoints used by this object adapter's incoming connection // factories are considered local. // - vector<EndpointIPtr> endpoints = ref->getEndpoints(); for(p = endpoints.begin(); p != endpoints.end(); ++p) { vector<IncomingConnectionFactoryPtr>::const_iterator q; |