diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-11-23 13:28:08 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-11-23 13:28:08 +0100 |
commit | 2c578015edcb36cdc0acd0227295de1dcca1b995 (patch) | |
tree | e163980b5dabb43a40089a29fdf8ff47a3e07f1c /java/src/Ice/ExceptionCallback.java | |
parent | no longer generating inspect method for each Ruby exception (diff) | |
download | ice-2c578015edcb36cdc0acd0227295de1dcca1b995.tar.bz2 ice-2c578015edcb36cdc0acd0227295de1dcca1b995.tar.xz ice-2c578015edcb36cdc0acd0227295de1dcca1b995.zip |
New AMI mapping
Diffstat (limited to 'java/src/Ice/ExceptionCallback.java')
-rw-r--r-- | java/src/Ice/ExceptionCallback.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/java/src/Ice/ExceptionCallback.java b/java/src/Ice/ExceptionCallback.java new file mode 100644 index 00000000000..733542b213a --- /dev/null +++ b/java/src/Ice/ExceptionCallback.java @@ -0,0 +1,50 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 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 Ice; + +/** + * An application can optionally supply an instance of this class in an + * asynchronous invocation. The application must create a subclass and + * implement the exception method. + **/ +public abstract class ExceptionCallback extends Callback +{ + /** + * Called when the invocation raises an Ice run-time exception. + * + * @param __ex The Ice run-time exception raised by the operation. + **/ + public abstract void exception(LocalException __ex); + + /** + * Called when a queued invocation is sent successfully. + **/ + public void sent() + { + } + + public final void __completed(AsyncResult __result) + { + try + { + __result.__wait(); + } + catch(LocalException __ex) + { + exception(__ex); + return; + } + } + + public final void __sent(AsyncResult __result) + { + sent(); + } +} |