diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-10 12:03:07 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-10 12:03:07 +0200 |
commit | 570455a381e6620f8ddfcca448559d3fa545ba38 (patch) | |
tree | fe3fa45e6a643b473d9370babff6224b1a9d4dcb /java/src/IceInternal/RetryQueue.java | |
parent | Fixed ICE-5726: provide deprecated public StringConverterPlugin (diff) | |
download | ice-570455a381e6620f8ddfcca448559d3fa545ba38.tar.bz2 ice-570455a381e6620f8ddfcca448559d3fa545ba38.tar.xz ice-570455a381e6620f8ddfcca448559d3fa545ba38.zip |
Fixed invocation timeouts/interrupt issues, addded AsyncResult.cancel()
Diffstat (limited to 'java/src/IceInternal/RetryQueue.java')
-rw-r--r-- | java/src/IceInternal/RetryQueue.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/java/src/IceInternal/RetryQueue.java b/java/src/IceInternal/RetryQueue.java index 2c322d1cb72..82831529545 100644 --- a/java/src/IceInternal/RetryQueue.java +++ b/java/src/IceInternal/RetryQueue.java @@ -16,8 +16,7 @@ public class RetryQueue _instance = instance; } - synchronized public void - add(OutgoingAsyncBase outAsync, int interval) + synchronized public void add(ProxyOutgoingAsyncBase outAsync, int interval) { if(_instance == null) { @@ -26,10 +25,10 @@ public class RetryQueue RetryTask task = new RetryTask(this, outAsync); task.setFuture(_instance.timer().schedule(task, interval, java.util.concurrent.TimeUnit.MILLISECONDS)); _requests.add(task); + outAsync.cancelable(task); } - synchronized public void - destroy() + synchronized public void destroy() { java.util.HashSet<RetryTask> keep = new java.util.HashSet<RetryTask>(); for(RetryTask task : _requests) @@ -65,14 +64,14 @@ public class RetryQueue } } - synchronized void - remove(RetryTask task) + synchronized boolean remove(RetryTask task) { - _requests.remove(task); + boolean removed = _requests.remove(task); if(_instance == null && _requests.isEmpty()) { notify(); } + return removed; } private Instance _instance; |