diff options
Diffstat (limited to 'cpp/src/Ice/ProxyFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ProxyFactory.cpp | 67 |
1 files changed, 15 insertions, 52 deletions
diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp index 2fc5316eb6d..4e5b67217fd 100644 --- a/cpp/src/Ice/ProxyFactory.cpp +++ b/cpp/src/Ice/ProxyFactory.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -25,32 +25,8 @@ using namespace std; using namespace Ice; using namespace IceInternal; -namespace -{ - -class RetryTask : public IceUtil::TimerTask -{ -public: - - RetryTask(const OutgoingAsyncPtr& out) : _out(out) - { - } - - virtual void - runTimerTask() - { - _out->__send(); - } - -private: - - const OutgoingAsyncPtr _out; -}; - -} - IceUtil::Shared* IceInternal::upCast(ProxyFactory* p) { return p; } - + ObjectPrx IceInternal::ProxyFactory::stringToProxy(const string& str) const { @@ -149,7 +125,11 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, // We retry ObjectNotExistException if the reference is // indirect. // - li->clearObjectCache(ref); + + if(ref->isWellKnown()) + { + li->clearCache(ref); + } } else if(ref->getRouterInfo() && one->operation == "ice_add_proxy") { @@ -243,34 +223,17 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, } out << " because of exception\n" << ex; } - - if(interval > 0) + + if(out) { - if(out) - { - try - { - _instance->timer()->schedule(new RetryTask(out), IceUtil::Time::milliSeconds(interval)); - } - catch(const IceUtil::IllegalArgumentException&) // Expected if the communicator destroyed the timer. - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - } - else - { - // - // Sleep before retrying. - // - IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); - } + out->__retry(interval); } - else + else if(interval > 0) { - if(out) - { - out->__send(); - } + // + // Sleep before retrying. + // + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); } } |