summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Outgoing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Outgoing.cpp')
-rw-r--r--cpp/src/Ice/Outgoing.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp
index 0a081181f0a..ebe39bd4f00 100644
--- a/cpp/src/Ice/Outgoing.cpp
+++ b/cpp/src/Ice/Outgoing.cpp
@@ -18,23 +18,31 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;
-IceInternal::NonRepeatable::NonRepeatable(const NonRepeatable& ex)
+IceInternal::LocalExceptionWrapper::LocalExceptionWrapper(const LocalException& ex, bool r) :
+ _retry(r)
{
- _ex.reset(dynamic_cast<LocalException*>(ex.get()->ice_clone()));
+ _ex.reset(dynamic_cast<LocalException*>(ex.ice_clone()));
}
-IceInternal::NonRepeatable::NonRepeatable(const ::Ice::LocalException& ex)
+IceInternal::LocalExceptionWrapper::LocalExceptionWrapper(const LocalExceptionWrapper& ex) :
+ _retry(ex._retry)
{
- _ex.reset(dynamic_cast<LocalException*>(ex.ice_clone()));
+ _ex.reset(dynamic_cast<LocalException*>(ex.get()->ice_clone()));
}
-const ::Ice::LocalException*
-IceInternal::NonRepeatable::get() const
+const LocalException*
+IceInternal::LocalExceptionWrapper::get() const
{
assert(_ex.get());
return _ex.get();
}
+bool
+IceInternal::LocalExceptionWrapper::retry() const
+{
+ return _retry;
+}
+
IceInternal::Outgoing::Outgoing(ConnectionI* connection, Reference* ref, const string& operation,
OperationMode mode, const Context& context, bool compress) :
_connection(connection),
@@ -207,11 +215,12 @@ IceInternal::Outgoing::invoke()
}
//
- // Throw the exception wrapped in a NonRepeatable, to
- // indicate that the request cannot be resent without
- // potentially violating the "at-most-once" principle.
+ // Throw the exception wrapped in a
+ // LocalExceptionWrapper, to indicate that the request
+ // cannot be resent without potentially violating the
+ // "at-most-once" principle.
//
- throw NonRepeatable(*_exception.get());
+ throw LocalExceptionWrapper(*_exception.get(), false);
}
if(_state == StateUserException)
@@ -275,7 +284,7 @@ IceInternal::Outgoing::abort(const LocalException& ex)
// only the batch request that caused the problem will be
// aborted, but all other requests in the batch as well.
//
- throw NonRepeatable(ex);
+ throw LocalExceptionWrapper(ex, false);
}
ex.ice_throw();