diff options
Diffstat (limited to 'java/test/Ice/interrupt/TestI.java')
-rw-r--r-- | java/test/Ice/interrupt/TestI.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/java/test/Ice/interrupt/TestI.java b/java/test/Ice/interrupt/TestI.java new file mode 100644 index 00000000000..cc267571c6f --- /dev/null +++ b/java/test/Ice/interrupt/TestI.java @@ -0,0 +1,68 @@ +// ********************************************************************** +// +// 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 test.Ice.interrupt; + +public class TestI extends test.Ice.interrupt.Test._TestIntfDisp +{ + private static void + test(boolean b) + { + if(!b) + { + throw new RuntimeException(); + } + } + + TestI(TestControllerI controller) + { + _controller = controller; + } + + @Override + public void + op(Ice.Current current) + { + } + + @Override + public void + sleep(int to, Ice.Current current) + throws test.Ice.interrupt.Test.InterruptedException + { + _controller.addUpcallThread(); + try + { + Thread.sleep(to); + } + catch(InterruptedException ex) + { + throw new test.Ice.interrupt.Test.InterruptedException(); + } + finally + { + _controller.removeUpcallThread(); + } + } + + @Override + public void + opWithPayload(byte[] seq, Ice.Current current) + { + } + + @Override + public void + shutdown(Ice.Current current) + { + current.adapter.getCommunicator().shutdown(); + } + + private TestControllerI _controller; +} |