summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ProxyBatchOutgoingAsync.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-10-10 12:03:07 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-10-10 12:03:07 +0200
commit570455a381e6620f8ddfcca448559d3fa545ba38 (patch)
treefe3fa45e6a643b473d9370babff6224b1a9d4dcb /java/src/IceInternal/ProxyBatchOutgoingAsync.java
parentFixed ICE-5726: provide deprecated public StringConverterPlugin (diff)
downloadice-570455a381e6620f8ddfcca448559d3fa545ba38.tar.bz2
ice-570455a381e6620f8ddfcca448559d3fa545ba38.tar.xz
ice-570455a381e6620f8ddfcca448559d3fa545ba38.zip
Fixed invocation timeouts/interrupt issues, addded AsyncResult.cancel()
Diffstat (limited to 'java/src/IceInternal/ProxyBatchOutgoingAsync.java')
-rw-r--r--java/src/IceInternal/ProxyBatchOutgoingAsync.java97
1 files changed, 0 insertions, 97 deletions
diff --git a/java/src/IceInternal/ProxyBatchOutgoingAsync.java b/java/src/IceInternal/ProxyBatchOutgoingAsync.java
deleted file mode 100644
index 4a575142da7..00000000000
--- a/java/src/IceInternal/ProxyBatchOutgoingAsync.java
+++ /dev/null
@@ -1,97 +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;
-
-public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
-{
- public ProxyBatchOutgoingAsync(Ice.ObjectPrxHelperBase prx, String operation, CallbackBase callback)
- {
- super(prx.ice_getCommunicator(), prx.__reference().getInstance(), operation, callback);
- _proxy = prx;
- _observer = ObserverHelper.get(prx, operation);
- }
-
- public void __invoke()
- {
- Protocol.checkSupportedProtocol(_proxy.__reference().getProtocol());
-
- try
- {
- _handler = _proxy.__getRequestHandler();
- int status = _handler.sendAsyncRequest(this);
- if((status & AsyncStatus.Sent) > 0)
- {
- _sentSynchronously = true;
- if((status & AsyncStatus.InvokeSentCallback) > 0)
- {
- invokeSent();
- }
- }
- else
- {
- synchronized(_monitor)
- {
- if((_state & StateDone) == 0)
- {
- int invocationTimeout = _handler.getReference().getInvocationTimeout();
- if(invocationTimeout > 0)
- {
- _future = _instance.timer().schedule(new Runnable()
- {
- @Override
- public void run()
- {
- timeout();
- }
- }, invocationTimeout, java.util.concurrent.TimeUnit.MILLISECONDS);
- _timeoutRequestHandler = _handler;
- }
- }
- }
- }
- }
- catch(RetryException ex)
- {
- //
- // Clear request handler but don't retry or throw. Retrying
- // isn't useful, there were no batch requests associated with
- // the proxy's request handler.
- //
- _proxy.__setRequestHandler(_handler, null);
- }
- catch(Ice.Exception ex)
- {
- if(_observer != null)
- {
- _observer.failed(ex.ice_name());
- }
- _proxy.__setRequestHandler(_handler, null); // Clear request handler
- throw ex; // Throw to notify the user lthat batch requests were potentially lost.
- }
- }
-
- @Override
- public Ice.ObjectPrx getProxy()
- {
- return _proxy;
- }
-
- @Override
- protected void cancelRequest()
- {
- if(_handler != null)
- {
- _handler.asyncRequestCanceled(this, new Ice.OperationInterruptedException());
- }
- }
-
- final private Ice.ObjectPrxHelperBase _proxy;
- private RequestHandler _handler = null;
-}