diff options
Diffstat (limited to 'java/src/IceInternal/RetryTask.java')
-rw-r--r-- | java/src/IceInternal/RetryTask.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/java/src/IceInternal/RetryTask.java b/java/src/IceInternal/RetryTask.java new file mode 100644 index 00000000000..5c17c8af621 --- /dev/null +++ b/java/src/IceInternal/RetryTask.java @@ -0,0 +1,44 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2008 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. +// +// ********************************************************************** + +package IceInternal; + +class RetryTask implements TimerTask +{ + RetryTask(RetryQueue queue, OutgoingAsync outAsync) + { + _queue = queue; + _outAsync = outAsync; + } + + public void + runTimerTask() + { + if(_queue.remove(this)) + { + try + { + _outAsync.__send(); + } + catch(Ice.LocalException ex) + { + _outAsync.__releaseCallback(ex); + } + } + } + + public void + destroy() + { + _outAsync.__releaseCallback(new Ice.CommunicatorDestroyedException()); + } + + private final RetryQueue _queue; + private final OutgoingAsync _outAsync; +} |