diff options
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(); + } +} |