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/ConnectionBatchOutgoingAsync.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/ConnectionBatchOutgoingAsync.java')
-rw-r--r-- | java/src/IceInternal/ConnectionBatchOutgoingAsync.java | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/java/src/IceInternal/ConnectionBatchOutgoingAsync.java b/java/src/IceInternal/ConnectionBatchOutgoingAsync.java deleted file mode 100644 index 5a1f0a30886..00000000000 --- a/java/src/IceInternal/ConnectionBatchOutgoingAsync.java +++ /dev/null @@ -1,107 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2014 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; - -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.RejectedExecutionException; - -import Ice.CommunicatorDestroyedException; - -public class ConnectionBatchOutgoingAsync extends BatchOutgoingAsync -{ - public ConnectionBatchOutgoingAsync(Ice.ConnectionI con, Ice.Communicator communicator, Instance instance, - String operation, CallbackBase callback) - { - super(communicator, instance, operation, callback); - _connection = con; - } - - public void __invoke() - { - int status; - if(_instance.queueRequests()) - { - Future<Integer> future = _instance.getQueueExecutor().submit(new Callable<Integer>() - { - @Override - public Integer call() throws RetryException - { - return _connection.flushAsyncBatchRequests(ConnectionBatchOutgoingAsync.this); - } - }); - - boolean interrupted = false; - while(true) - { - try - { - status = future.get(); - if(interrupted) - { - Thread.currentThread().interrupt(); - } - break; - } - catch(InterruptedException ex) - { - interrupted = true; - } - catch(RejectedExecutionException e) - { - throw new CommunicatorDestroyedException(); - } - catch(ExecutionException e) - { - try - { - throw e.getCause(); - } - catch(RuntimeException ex) - { - throw ex; - } - catch(Throwable ex) - { - assert(false); - } - } - } - } - else - { - status = _connection.flushAsyncBatchRequests(this); - } - - if((status & AsyncStatus.Sent) > 0) - { - _sentSynchronously = true; - if((status & AsyncStatus.InvokeSentCallback) > 0) - { - invokeSent(); - } - } - } - - @Override - public Ice.Connection getConnection() - { - return _connection; - } - - @Override - protected void cancelRequest() - { - _connection.asyncRequestCanceled(this, new Ice.OperationInterruptedException()); - } - - private Ice.ConnectionI _connection; -} |