diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/_AMD_Object_ice_invoke.java | 9 | ||||
-rw-r--r-- | java/src/IceInternal/IncomingAsync.java | 128 |
2 files changed, 62 insertions, 75 deletions
diff --git a/java/src/Ice/_AMD_Object_ice_invoke.java b/java/src/Ice/_AMD_Object_ice_invoke.java index f5d07bd7b3f..ef2d9bc1aaf 100644 --- a/java/src/Ice/_AMD_Object_ice_invoke.java +++ b/java/src/Ice/_AMD_Object_ice_invoke.java @@ -34,13 +34,4 @@ final class _AMD_Object_ice_invoke extends IceInternal.IncomingAsync implements __response(ok); } } - - public void - ice_exception(java.lang.Exception ex) - { - if(__validateException(ex)) - { - __exception(ex); - } - } } diff --git a/java/src/IceInternal/IncomingAsync.java b/java/src/IceInternal/IncomingAsync.java index 3938d47f67d..0bfe344094b 100644 --- a/java/src/IceInternal/IncomingAsync.java +++ b/java/src/IceInternal/IncomingAsync.java @@ -9,7 +9,7 @@ package IceInternal; -public class IncomingAsync extends IncomingBase +public class IncomingAsync extends IncomingBase implements Ice.AMDCallback { public IncomingAsync(Incoming in) // Adopts the argument. It must not be used afterwards. @@ -24,6 +24,48 @@ public class IncomingAsync extends IncomingBase } } + public void + ice_exception(java.lang.Exception ex) + { + // + // Only call __exception if this incoming is not retriable or if + // all the interceptors return true and no response has been sent + // yet. + // + + if(_retriable) + { + try + { + if(_interceptorAsyncCallbackList != null) + { + for(Ice.DispatchInterceptorAsyncCallback cb : _interceptorAsyncCallbackList) + { + if(cb.exception(ex) == false) + { + return; + } + } + } + } + catch(java.lang.RuntimeException exc) + { + return; + } + + synchronized(this) + { + if(!_active) + { + return; + } + _active = false; + } + } + + __exception(ex); + } + final void __deactivate(Incoming in) { @@ -108,89 +150,43 @@ public class IncomingAsync extends IncomingBase final protected boolean __validateResponse(boolean ok) { - if(!_retriable) - { - return true; - } + // + // Only returns true if this incoming is not retriable or if all + // the interceptors return true and no response has been sent + // yet. Upon getting a true return value, the caller should send + // the response. + // - try + if(_retriable) { - if(_interceptorAsyncCallbackList != null) + try { - for(Ice.DispatchInterceptorAsyncCallback cb : _interceptorAsyncCallbackList) + if(_interceptorAsyncCallbackList != null) { - if(cb.response(ok) == false) + for(Ice.DispatchInterceptorAsyncCallback cb : _interceptorAsyncCallbackList) { - return false; + if(cb.response(ok) == false) + { + return false; + } } } } - } - catch(java.lang.RuntimeException ex) - { - return false; - } - - // - // interceptorAsyncCallbackList is null or all its elements returned OK - // - - synchronized(this) - { - if(_active) - { - _active = false; - return true; - } - else + catch(java.lang.RuntimeException ex) { return false; } - } - } - - final protected boolean - __validateException(java.lang.Exception exc) - { - if(!_retriable) - { - return true; - } - try - { - if(_interceptorAsyncCallbackList != null) + synchronized(this) { - for(Ice.DispatchInterceptorAsyncCallback cb : _interceptorAsyncCallbackList) + if(!_active) { - if(cb.exception(exc) == false) - { - return false; - } + return false; } - } - } - catch(java.lang.RuntimeException ex) - { - return false; - } - - // - // interceptorAsyncCallbackList is null or all its elements returned OK - // - - synchronized(this) - { - if(_active) - { _active = false; - return true; - } - else - { - return false; } } + return true; } final protected BasicStream |