summaryrefslogtreecommitdiff
path: root/java/test/Ice/retry/RetryI.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/test/Ice/retry/RetryI.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/test/Ice/retry/RetryI.java')
-rw-r--r--java/test/Ice/retry/RetryI.java55
1 files changed, 54 insertions, 1 deletions
diff --git a/java/test/Ice/retry/RetryI.java b/java/test/Ice/retry/RetryI.java
index 22a98b566ad..ae336cac007 100644
--- a/java/test/Ice/retry/RetryI.java
+++ b/java/test/Ice/retry/RetryI.java
@@ -22,13 +22,66 @@ public final class RetryI extends _RetryDisp
{
if(kill)
{
- current.con.close(true);
+ if(current.con != null)
+ {
+ current.con.close(true);
+ }
+ else
+ {
+ throw new Ice.ConnectionLostException();
+ }
}
}
+ public int
+ opIdempotent(int counter, Ice.Current current)
+ {
+ if(counter + nRetry > _counter)
+ {
+ ++_counter;
+ if(current.con != null)
+ {
+ current.con.close(true);
+ }
+ else
+ {
+ throw new Ice.ConnectionLostException();
+ }
+ }
+ return _counter;
+ }
+
+ public void
+ opNotIdempotent(int counter, Ice.Current current)
+ {
+ if(_counter != counter)
+ {
+ return;
+ }
+
+ ++_counter;
+ if(current.con != null)
+ {
+ current.con.close(true);
+ }
+ else
+ {
+ throw new Ice.ConnectionLostException();
+ }
+ }
+
+ public void
+ opSystemException(Ice.Current c)
+ {
+ throw new SystemFailure();
+ }
+
public void
shutdown(Ice.Current current)
{
current.adapter.getCommunicator().shutdown();
}
+
+ private int _counter;
+ static final int nRetry = 4;
}