diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-09-27 16:31:46 -0700 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-09-27 16:32:21 -0700 |
commit | 4951bbabdd6bd33a8e9ca0cdd46aad613a634626 (patch) | |
tree | 8634b14a258d2c9cee0e17a12af805e1af3fec76 /java/src/IceInternal/ProxyBatchOutgoingAsync.java | |
parent | Fixed deadlock in connection binding code (ICE-5693) (diff) | |
download | ice-4951bbabdd6bd33a8e9ca0cdd46aad613a634626.tar.bz2 ice-4951bbabdd6bd33a8e9ca0cdd46aad613a634626.tar.xz ice-4951bbabdd6bd33a8e9ca0cdd46aad613a634626.zip |
- begin_ now never interrupts.
- All potentially blocking Ice APIs are interruption points.
- Fixes to the incoming/outgoing factories and shutdown procedure
- Fixed bug where connect() was from a user thread.
- Added lots more tests to the interrupt test suite.
Diffstat (limited to 'java/src/IceInternal/ProxyBatchOutgoingAsync.java')
-rw-r--r-- | java/src/IceInternal/ProxyBatchOutgoingAsync.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/java/src/IceInternal/ProxyBatchOutgoingAsync.java b/java/src/IceInternal/ProxyBatchOutgoingAsync.java index 009319110fe..f98bd51f997 100644 --- a/java/src/IceInternal/ProxyBatchOutgoingAsync.java +++ b/java/src/IceInternal/ProxyBatchOutgoingAsync.java @@ -22,11 +22,10 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync { Protocol.checkSupportedProtocol(_proxy.__reference().getProtocol()); - RequestHandler handler = null; try { - handler = _proxy.__getRequestHandler(); - int status = handler.sendAsyncRequest(this); + _handler = _proxy.__getRequestHandler(); + int status = _handler.sendAsyncRequest(this); if((status & AsyncStatus.Sent) > 0) { _sentSynchronously = true; @@ -41,7 +40,7 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync { if((_state & StateDone) == 0) { - int invocationTimeout = handler.getReference().getInvocationTimeout(); + int invocationTimeout = _handler.getReference().getInvocationTimeout(); if(invocationTimeout > 0) { _future = _instance.timer().schedule(new Runnable() @@ -52,7 +51,7 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync timeout(); } }, invocationTimeout, java.util.concurrent.TimeUnit.MILLISECONDS); - _timeoutRequestHandler = handler; + _timeoutRequestHandler = _handler; } } } @@ -65,7 +64,7 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync // isn't useful, there were no batch requests associated with // the proxy's request handler. // - _proxy.__setRequestHandler(handler, null); + _proxy.__setRequestHandler(_handler, null); } catch(Ice.Exception ex) { @@ -73,7 +72,7 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync { _observer.failed(ex.ice_name()); } - _proxy.__setRequestHandler(handler, null); // Clear request handler + _proxy.__setRequestHandler(_handler, null); // Clear request handler throw ex; // Throw to notify the user lthat batch requests were potentially lost. } } @@ -84,5 +83,15 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync return _proxy; } + @Override + protected void cancelRequest() + { + if(_handler != null) + { + _handler.asyncRequestCanceled(this, new Ice.OperationInterruptedException()); + } + } + private Ice.ObjectPrxHelperBase _proxy; + private RequestHandler _handler = null; } |