summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-07-02 16:02:58 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-07-02 16:02:58 +0000
commite7481ff5c45af0db4e9d27cdf7ce40c4f4a50e5f (patch)
treea10459074d42944f7f1572de83c16415f6f752f8 /cpp/src
parentfixed connection verification bug (diff)
downloadice-e7481ff5c45af0db4e9d27cdf7ce40c4f4a50e5f.tar.bz2
ice-e7481ff5c45af0db4e9d27cdf7ce40c4f4a50e5f.tar.xz
ice-e7481ff5c45af0db4e9d27cdf7ce40c4f4a50e5f.zip
Removed Proxy _retryIntervals.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Proxy.cpp40
-rw-r--r--cpp/src/Ice/ProxyFactory.cpp8
-rw-r--r--cpp/src/Ice/ProxyFactory.h2
3 files changed, 28 insertions, 22 deletions
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index ee704a8b569..0ffd718da5f 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -293,7 +293,7 @@ IceProxy::Ice::Object::ice_newIdentity(const Identity& newIdentity) const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(_reference->changeIdentity(newIdentity), _retryIntervals);
+ proxy->setup(_reference->changeIdentity(newIdentity));
return proxy;
}
}
@@ -314,7 +314,7 @@ IceProxy::Ice::Object::ice_newFacet(const string& newFacet) const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(_reference->changeFacet(newFacet), _retryIntervals);
+ proxy->setup(_reference->changeFacet(newFacet));
return proxy;
}
}
@@ -330,7 +330,7 @@ IceProxy::Ice::Object::ice_twoway() const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -346,7 +346,7 @@ IceProxy::Ice::Object::ice_oneway() const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -362,7 +362,7 @@ IceProxy::Ice::Object::ice_batchOneway() const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -378,7 +378,7 @@ IceProxy::Ice::Object::ice_datagram() const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -394,7 +394,7 @@ IceProxy::Ice::Object::ice_batchDatagram() const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -410,7 +410,7 @@ IceProxy::Ice::Object::ice_secure(bool b) const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -426,7 +426,7 @@ IceProxy::Ice::Object::ice_compress(bool b) const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -442,7 +442,7 @@ IceProxy::Ice::Object::ice_timeout(int t) const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -458,7 +458,7 @@ IceProxy::Ice::Object::ice_router(const RouterPrx& router) const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -474,7 +474,7 @@ IceProxy::Ice::Object::ice_default() const
else
{
ObjectPrx proxy(new ::IceProxy::Ice::Object());
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
}
@@ -498,13 +498,11 @@ IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from)
ReferencePtr ref;
Handle< ::IceDelegateD::Ice::Object> delegateD;
Handle< ::IceDelegateM::Ice::Object> delegateM;
- vector<int> retryIntervals;
{
IceUtil::Mutex::Lock sync(*from.get());
ref = from->_reference;
- retryIntervals = from->_retryIntervals;
delegateD = dynamic_cast< ::IceDelegateD::Ice::Object*>(from->_delegate.get());
delegateM = dynamic_cast< ::IceDelegateM::Ice::Object*>(from->_delegate.get());
}
@@ -515,7 +513,6 @@ IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from)
//
_reference = ref;
- _retryIntervals = retryIntervals;
if(delegateD)
{
@@ -565,7 +562,9 @@ IceProxy::Ice::Object::__handleException(const LocalException& ex, int& cnt)
TraceLevelsPtr traceLevels = _reference->instance->traceLevels();
LoggerPtr logger = _reference->instance->logger();
- if(cnt > (int)_retryIntervals.size())
+ const std::vector<int>& retryIntervals = _reference->instance->proxyFactory()->getRetryIntervals();
+
+ if(cnt > (int)retryIntervals.size())
{
if(traceLevels->retry >= 1)
{
@@ -579,9 +578,9 @@ IceProxy::Ice::Object::__handleException(const LocalException& ex, int& cnt)
{
Trace out(logger, traceLevels->retryCat);
out << "re-trying operation call";
- if(cnt > 0 && _retryIntervals[cnt - 1] > 0)
+ if(cnt > 0 && retryIntervals[cnt - 1] > 0)
{
- out << " in " << _retryIntervals[cnt - 1] << " (ms)";
+ out << " in " << retryIntervals[cnt - 1] << " (ms)";
}
out << " because of exception\n" << ex;
}
@@ -592,7 +591,7 @@ IceProxy::Ice::Object::__handleException(const LocalException& ex, int& cnt)
// Sleep before retrying. TODO: is it safe to sleep here
// with the mutex locked?
//
- IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(_retryIntervals[cnt - 1]));
+ IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(retryIntervals[cnt - 1]));
}
}
@@ -681,14 +680,13 @@ IceProxy::Ice::Object::__createDelegateD()
}
void
-IceProxy::Ice::Object::setup(const ReferencePtr& ref, const vector<int>& retryIntervals)
+IceProxy::Ice::Object::setup(const ReferencePtr& ref)
{
//
// No need to synchronize "*this", as this operation is only
// called upon initialization.
//
_reference = ref;
- _retryIntervals = retryIntervals;
}
IceDelegateM::Ice::Object::~Object()
diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp
index 93d7d9af484..8ce9567e156 100644
--- a/cpp/src/Ice/ProxyFactory.cpp
+++ b/cpp/src/Ice/ProxyFactory.cpp
@@ -86,10 +86,16 @@ ObjectPrx
IceInternal::ProxyFactory::referenceToProxy(const ReferencePtr& ref) const
{
ObjectPrx proxy = new ::IceProxy::Ice::Object;
- proxy->setup(ref, _retryIntervals);
+ proxy->setup(ref);
return proxy;
}
+const std::vector<int>&
+IceInternal::ProxyFactory::getRetryIntervals() const
+{
+ return _retryIntervals;
+}
+
IceInternal::ProxyFactory::ProxyFactory(const InstancePtr& instance) :
_instance(instance)
{
diff --git a/cpp/src/Ice/ProxyFactory.h b/cpp/src/Ice/ProxyFactory.h
index 4c637d7c135..0141dccfa4c 100644
--- a/cpp/src/Ice/ProxyFactory.h
+++ b/cpp/src/Ice/ProxyFactory.h
@@ -35,6 +35,8 @@ public:
::Ice::ObjectPrx referenceToProxy(const ReferencePtr&) const;
+ const ::std::vector<int>& getRetryIntervals() const;
+
private:
ProxyFactory(const InstancePtr&);