summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ProxyBatchOutgoingAsync.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-06-27 10:31:41 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-06-27 10:31:41 +0200
commita4f93259dc3494d98addf38e69b87eb557d432b3 (patch)
treed2b78bb5cea24e33dc1b46be22dba6167e96c9ed /java/src/IceInternal/ProxyBatchOutgoingAsync.java
parentFix for ICE-5515 (ice_staticId on proxies) in Java, C#, Python, Ruby and PHP ... (diff)
downloadice-a4f93259dc3494d98addf38e69b87eb557d432b3.tar.bz2
ice-a4f93259dc3494d98addf38e69b87eb557d432b3.tar.xz
ice-a4f93259dc3494d98addf38e69b87eb557d432b3.zip
Better collocation optimization, fix for ICE-5489, ICE-5484
Diffstat (limited to 'java/src/IceInternal/ProxyBatchOutgoingAsync.java')
-rw-r--r--java/src/IceInternal/ProxyBatchOutgoingAsync.java45
1 files changed, 22 insertions, 23 deletions
diff --git a/java/src/IceInternal/ProxyBatchOutgoingAsync.java b/java/src/IceInternal/ProxyBatchOutgoingAsync.java
index 8bea231573d..77a82ae2772 100644
--- a/java/src/IceInternal/ProxyBatchOutgoingAsync.java
+++ b/java/src/IceInternal/ProxyBatchOutgoingAsync.java
@@ -11,11 +11,10 @@ package IceInternal;
public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
{
- public ProxyBatchOutgoingAsync(Ice.ObjectPrx prx, String operation, CallbackBase callback)
+ public ProxyBatchOutgoingAsync(Ice.ObjectPrxHelperBase prx, String operation, CallbackBase callback)
{
- super(prx.ice_getCommunicator(), ((Ice.ObjectPrxHelperBase)prx).__reference().getInstance(), operation,
- callback);
- _proxy = (Ice.ObjectPrxHelperBase)prx;
+ super(prx.ice_getCommunicator(), prx.__reference().getInstance(), operation, callback);
+ _proxy = prx;
_observer = ObserverHelper.get(prx, operation);
}
@@ -23,25 +22,11 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
{
Protocol.checkSupportedProtocol(_proxy.__reference().getProtocol());
- //
- // We don't automatically retry if ice_flushBatchRequests fails. Otherwise, if some batch
- // requests were queued with the connection, they would be lost without being noticed.
- //
- Ice._ObjectDel delegate = null;
- int cnt = -1; // Don't retry.
+ RequestHandler handler = null;
try
{
- delegate = _proxy.__getDelegate(false);
- RequestHandler handler = delegate.__getRequestHandler();
- int status;
- try
- {
- status = handler.sendAsyncRequest(this);
- }
- catch(IceInternal.LocalExceptionWrapper ex)
- {
- throw ex.get();
- }
+ handler = _proxy.__getRequestHandler(true);
+ int status = handler.sendAsyncRequest(this);
if((status & AsyncStatus.Sent) > 0)
{
_sentSynchronously = true;
@@ -66,9 +51,23 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
}
}
}
- catch(Ice.LocalException __ex)
+ catch(RetryException ex)
{
- cnt = _proxy.__handleException(delegate, __ex, null, cnt, _observer);
+ //
+ // 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.
}
}