diff options
-rw-r--r-- | cpp/src/Ice/LocatorInfo.cpp | 124 | ||||
-rw-r--r-- | cpp/src/Ice/LocatorInfo.h | 13 | ||||
-rw-r--r-- | cpp/src/Ice/ProxyFactory.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/RouterInfo.cpp | 24 | ||||
-rw-r--r-- | cpp/src/Ice/RouterInfo.h | 1 | ||||
-rw-r--r-- | csharp/src/Ice/LocatorInfo.cs | 119 | ||||
-rw-r--r-- | js/src/Ice/LocatorInfo.js | 2 |
8 files changed, 13 insertions, 274 deletions
diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp index 181382909f2..0871c59377e 100644 --- a/cpp/src/Ice/LocatorInfo.cpp +++ b/cpp/src/Ice/LocatorInfo.cpp @@ -371,7 +371,7 @@ IceInternal::LocatorInfo::RequestCallback::response(const LocatorInfoPtr& locato // by the locator is an indirect proxy. We now need to resolve the endpoints // of this indirect proxy. // - locatorInfo->getEndpointsWithCallback(r, _ref, _ttl, _callback); + locatorInfo->getEndpoints(r, _ref, _ttl, _callback); return; } } @@ -446,66 +446,6 @@ IceInternal::LocatorInfo::Request::addCallback(const ReferencePtr& ref, } } -vector<EndpointIPtr> -IceInternal::LocatorInfo::Request::getEndpoints(const ReferencePtr& ref, - const ReferencePtr& wellKnownRef, - int ttl, - bool& cached) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); - if(!_response && !_exception) - { - if(wellKnownRef) // This request is to resolve the endpoints of a cached well-known object reference - { - _wellKnownRefs.push_back(wellKnownRef); - } - if(!_sent) - { - _sent = true; - sync.release(); - send(); // send() might call exception() from this thread so we need to release the mutex. - sync.acquire(); - } - - while(!_response && !_exception) - { - _monitor.wait(); - } - } - - if(_exception) - { - _locatorInfo->getEndpointsException(ref, *_exception); // This throws. - } - - assert(_response); - vector<EndpointIPtr> endpoints; - if(_proxy) - { - ReferencePtr r = _proxy->_getReference(); - if(!r->isIndirect()) - { - endpoints = r->getEndpoints(); - } - else if(ref->isWellKnown() && !r->isWellKnown()) - { - // - // We're resolving the endpoints of a well-known object and the proxy returned - // by the locator is an indirect proxy. We now need to resolve the endpoints - // of this indirect proxy. - // - return _locatorInfo->getEndpoints(r, ref, ttl, cached); - } - } - - cached = false; - if(_ref->getInstance()->traceLevels()->location >= 1) - { - _locatorInfo->getEndpointsTrace(ref, endpoints, false); - } - return endpoints; -} - IceInternal::LocatorInfo::Request::Request(const LocatorInfoPtr& locatorInfo, const ReferencePtr& ref) : _locatorInfo(locatorInfo), _ref(ref), _sent(false), _response(false) { @@ -606,64 +546,12 @@ IceInternal::LocatorInfo::getLocatorRegistry() } } -vector<EndpointIPtr> -IceInternal::LocatorInfo::getEndpoints(const ReferencePtr& ref, const ReferencePtr& wellKnownRef, int ttl, bool& cached) -{ - assert(ref->isIndirect()); - vector<EndpointIPtr> endpoints; - if(!ref->isWellKnown()) - { - if(!_table->getAdapterEndpoints(ref->getAdapterId(), ttl, endpoints)) - { - if(_background && !endpoints.empty()) - { - getAdapterRequest(ref)->addCallback(ref, wellKnownRef, ttl, 0); - } - else - { - return getAdapterRequest(ref)->getEndpoints(ref, wellKnownRef, ttl, cached); - } - } - } - else - { - ReferencePtr r; - if(!_table->getObjectReference(ref->getIdentity(), ttl, r)) - { - if(_background && r) - { - getObjectRequest(ref)->addCallback(ref, 0, ttl, 0); - } - else - { - return getObjectRequest(ref)->getEndpoints(ref, 0, ttl, cached); - } - } - - if(!r->isIndirect()) - { - endpoints = r->getEndpoints(); - } - else if(!r->isWellKnown()) - { - return getEndpoints(r, ref, ttl, cached); - } - } - - assert(!endpoints.empty()); - cached = true; - if(ref->getInstance()->traceLevels()->location >= 1) - { - getEndpointsTrace(ref, endpoints, true); - } - return endpoints; -} void -IceInternal::LocatorInfo::getEndpointsWithCallback(const ReferencePtr& ref, - const ReferencePtr& wellKnownRef, - int ttl, - const GetEndpointsCallbackPtr& callback) +IceInternal::LocatorInfo::getEndpoints(const ReferencePtr& ref, + const ReferencePtr& wellKnownRef, + int ttl, + const GetEndpointsCallbackPtr& callback) { assert(ref->isIndirect()); vector<EndpointIPtr> endpoints; @@ -704,7 +592,7 @@ IceInternal::LocatorInfo::getEndpointsWithCallback(const ReferencePtr& ref, } else if(!r->isWellKnown()) { - getEndpointsWithCallback(r, ref, ttl, callback); + getEndpoints(r, ref, ttl, callback); return; } } diff --git a/cpp/src/Ice/LocatorInfo.h b/cpp/src/Ice/LocatorInfo.h index 7809f211eb1..8bd1716790f 100644 --- a/cpp/src/Ice/LocatorInfo.h +++ b/cpp/src/Ice/LocatorInfo.h @@ -117,7 +117,6 @@ public: public: void addCallback(const ReferencePtr&, const ReferencePtr&, int, const GetEndpointsCallbackPtr&); - std::vector<EndpointIPtr> getEndpoints(const ReferencePtr&, const ReferencePtr&, int, bool&); void response(const Ice::ObjectPrxPtr&); void exception(const Ice::Exception&); @@ -159,17 +158,11 @@ public: } Ice::LocatorRegistryPrxPtr getLocatorRegistry(); - std::vector<EndpointIPtr> getEndpoints(const ReferencePtr& ref, int ttl, bool& cached) + void getEndpoints(const ReferencePtr& ref, int ttl, const GetEndpointsCallbackPtr& cb) { - return getEndpoints(ref, 0, ttl, cached); + getEndpoints(ref, 0, ttl, cb); } - std::vector<EndpointIPtr> getEndpoints(const ReferencePtr&, const ReferencePtr&, int, bool&); - - void getEndpointsWithCallback(const ReferencePtr& ref, int ttl, const GetEndpointsCallbackPtr& cb) - { - getEndpointsWithCallback(ref, 0, ttl, cb); - } - void getEndpointsWithCallback(const ReferencePtr&, const ReferencePtr&, int, const GetEndpointsCallbackPtr&); + void getEndpoints(const ReferencePtr&, const ReferencePtr&, int, const GetEndpointsCallbackPtr&); void clearCache(const ReferencePtr&); diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp index 34503ec961b..c3b169f6ce0 100644 --- a/cpp/src/Ice/ProxyFactory.cpp +++ b/cpp/src/Ice/ProxyFactory.cpp @@ -230,7 +230,7 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co // limit is reached. // interval = 0; - } + } else if(cnt > static_cast<int>(_retryIntervals.size())) { if(traceLevels->retry >= 1) diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 31cd7631479..b222b506352 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1676,7 +1676,7 @@ IceInternal::RoutableReference::getConnectionNoRouterInfo(const GetConnectionCal if(_locatorInfo) { RoutableReference* self = const_cast<RoutableReference*>(this); - _locatorInfo->getEndpointsWithCallback(self, _locatorCacheTimeout, new Callback(self, callback)); + _locatorInfo->getEndpoints(self, _locatorCacheTimeout, new Callback(self, callback)); } else { diff --git a/cpp/src/Ice/RouterInfo.cpp b/cpp/src/Ice/RouterInfo.cpp index 3367a743077..a4723f59217 100644 --- a/cpp/src/Ice/RouterInfo.cpp +++ b/cpp/src/Ice/RouterInfo.cpp @@ -109,8 +109,7 @@ IceInternal::RouterManager::erase(const RouterPrxPtr& rtr) return info; } -IceInternal::RouterInfo::RouterInfo(const RouterPrxPtr& router) : - _router(router) +IceInternal::RouterInfo::RouterInfo(const RouterPrxPtr& router) : _router(router) { assert(_router); } @@ -222,27 +221,6 @@ IceInternal::RouterInfo::getServerEndpoints() } void -IceInternal::RouterInfo::addProxy(const ObjectPrxPtr& proxy) -{ - assert(proxy); // Must not be called for null proxies. - - { - IceUtil::Mutex::Lock sync(*this); - if(_identities.find(proxy->ice_getIdentity()) != _identities.end()) - { - // - // Only add the proxy to the router if it's not already in our local map. - // - return; - } - } - - ObjectProxySeq proxies; - proxies.push_back(proxy); - addAndEvictProxies(proxy, _router->addProxies(proxies)); -} - -void IceInternal::RouterInfo::addProxyResponse(const Ice::ObjectProxySeq& proxies, const AddProxyCookiePtr& cookie) { addAndEvictProxies(cookie->proxy(), proxies); diff --git a/cpp/src/Ice/RouterInfo.h b/cpp/src/Ice/RouterInfo.h index 76b70bb7bd5..f307bee2044 100644 --- a/cpp/src/Ice/RouterInfo.h +++ b/cpp/src/Ice/RouterInfo.h @@ -128,7 +128,6 @@ public: void addProxyResponse(const Ice::ObjectProxySeq&, const AddProxyCookiePtr&); void addProxyException(const Ice::Exception&, const AddProxyCookiePtr&); - void addProxy(const Ice::ObjectPrxPtr&); bool addProxy(const Ice::ObjectPrxPtr&, const AddProxyCallbackPtr&); void setAdapter(const Ice::ObjectAdapterPtr&); diff --git a/csharp/src/Ice/LocatorInfo.cs b/csharp/src/Ice/LocatorInfo.cs index 3b5c9bc7422..e1c036fc81f 100644 --- a/csharp/src/Ice/LocatorInfo.cs +++ b/csharp/src/Ice/LocatorInfo.cs @@ -130,64 +130,6 @@ namespace IceInternal } } - public EndpointI[] - getEndpoints(Reference @ref, Reference wellKnownRef, int ttl, out bool cached) - { - lock(this) - { - if(!_response || _exception == null) - { - if(wellKnownRef != null) - { - // This request is to resolve the endpoints of a cached well-known object ref - _wellKnownRefs.Add(wellKnownRef); - } - if(!_sent) - { - _sent = true; - send(); - } - - while(!_response && _exception == null) - { - Monitor.Wait(this); - } - } - - if(_exception != null) - { - _locatorInfo.getEndpointsException(@ref, _exception); // This throws. - } - - Debug.Assert(_response); - EndpointI[] endpoints = null; - if(_proxy != null) - { - Reference r = ((Ice.ObjectPrxHelperBase)_proxy).iceReference(); - if(!r.isIndirect()) - { - endpoints = r.getEndpoints(); - } - else if(@ref.isWellKnown() && !r.isWellKnown()) - { - // - // We're resolving the endpoints of a well-known object and the proxy returned - // by the locator is an indirect proxy. We now need to resolve the endpoints - // of this indirect proxy. - // - return _locatorInfo.getEndpoints(r, @ref, ttl, out cached); - } - } - - cached = false; - if(_ref.getInstance().traceLevels().location >= 1) - { - _locatorInfo.getEndpointsTrace(@ref, endpoints, false); - } - return endpoints == null ? new EndpointI[0] : endpoints; - } - } - public Request(LocatorInfo locatorInfo, Reference @ref) { _locatorInfo = locatorInfo; @@ -354,67 +296,6 @@ namespace IceInternal } } - public EndpointI[] - getEndpoints(Reference @ref, int ttl, out bool cached) - { - return getEndpoints(@ref, null, ttl, out cached); - } - - public EndpointI[] - getEndpoints(Reference @ref, Reference wellKnownRef, int ttl, out bool cached) - { - Debug.Assert(@ref.isIndirect()); - EndpointI[] endpoints = null; - cached = false; - if(!@ref.isWellKnown()) - { - endpoints = _table.getAdapterEndpoints(@ref.getAdapterId(), ttl, out cached); - if(!cached) - { - if(_background && endpoints != null) - { - getAdapterRequest(@ref).addCallback(@ref, wellKnownRef, ttl, null); - } - else - { - return getAdapterRequest(@ref).getEndpoints(@ref, wellKnownRef, ttl, out cached); - } - } - } - else - { - Reference r = _table.getObjectReference(@ref.getIdentity(), ttl, out cached); - if(!cached) - { - if(_background && r != null) - { - getObjectRequest(@ref).addCallback(@ref, null, ttl, null); - } - else - { - return getObjectRequest(@ref).getEndpoints(@ref, null, ttl, out cached); - } - } - - if(!r.isIndirect()) - { - endpoints = r.getEndpoints(); - } - else if(!r.isWellKnown()) - { - return getEndpoints(r, @ref, ttl, out cached); - } - } - - Debug.Assert(endpoints != null); - cached = true; - if(@ref.getInstance().traceLevels().location >= 1) - { - getEndpointsTrace(@ref, endpoints, true); - } - return endpoints; - } - public void getEndpoints(Reference @ref, int ttl, GetEndpointsCallback callback) { diff --git a/js/src/Ice/LocatorInfo.js b/js/src/Ice/LocatorInfo.js index f1ba37a7fb6..249a9cac27b 100644 --- a/js/src/Ice/LocatorInfo.js +++ b/js/src/Ice/LocatorInfo.js @@ -58,7 +58,7 @@ class LocatorInfo return false; } - + hashCode() { return this._locator.hashCode(); |