diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-09-25 12:24:57 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-09-25 12:24:57 +0200 |
commit | 356e14707a342da8102b731503c8f2628c1cc79b (patch) | |
tree | b15b837cad964f6ab3a66670ac6eb89a1d832677 /java/src/IceInternal/RetryQueue.java | |
parent | Fixed compilation problem with Ruby on OS X (diff) | |
download | ice-356e14707a342da8102b731503c8f2628c1cc79b.tar.bz2 ice-356e14707a342da8102b731503c8f2628c1cc79b.tar.xz ice-356e14707a342da8102b731503c8f2628c1cc79b.zip |
Fixed ICE-5687 - adapterDeactivation test warnings
Diffstat (limited to 'java/src/IceInternal/RetryQueue.java')
-rw-r--r-- | java/src/IceInternal/RetryQueue.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/java/src/IceInternal/RetryQueue.java b/java/src/IceInternal/RetryQueue.java index 023992f31f9..232ee1568cd 100644 --- a/java/src/IceInternal/RetryQueue.java +++ b/java/src/IceInternal/RetryQueue.java @@ -19,6 +19,10 @@ public class RetryQueue synchronized public void add(OutgoingAsyncMessageCallback outAsync, int interval) { + if(_instance == null) + { + throw new Ice.CommunicatorDestroyedException(); + } RetryTask task = new RetryTask(this, outAsync); task.setFuture(_instance.timer().schedule(task, interval, java.util.concurrent.TimeUnit.MILLISECONDS)); _requests.add(task); @@ -27,6 +31,7 @@ public class RetryQueue synchronized public void destroy() { + _instance = null; for(RetryTask task : _requests) { task.destroy(); @@ -40,6 +45,6 @@ public class RetryQueue return _requests.remove(task); } - final private Instance _instance; + private Instance _instance; final private java.util.HashSet<RetryTask> _requests = new java.util.HashSet<RetryTask>(); } |