use of io.joynr.proxy.invocation.MethodInvocation in project joynr by bmwcarit.
the class ProxyInvocationHandlerImpl method abort.
@Override
public void abort(JoynrRuntimeException exception) {
setThrowableForInvoke(exception);
for (Iterator<MethodInvocation<?>> iterator = queuedRpcList.iterator(); iterator.hasNext(); ) {
MethodInvocation<?> invocation = iterator.next();
try {
MethodMetaInformation metaInfo = new MethodMetaInformation(invocation.getMethod());
int callbackIndex = metaInfo.getCallbackIndex();
if (callbackIndex > -1) {
ICallback callback = (ICallback) invocation.getArgs()[callbackIndex];
callback.onFailure(exception);
}
} catch (Exception metaInfoException) {
logger.error("aborting call to method: " + invocation.getMethod().getName() + " but unable to call onError callback because of: " + metaInfoException.getMessage(), metaInfoException);
}
invocation.getFuture().onFailure(exception);
}
for (Iterator<UnsubscribeInvocation> iterator = queuedUnsubscripeInvocationList.iterator(); iterator.hasNext(); ) {
Invocation<String> invocation = iterator.next();
invocation.getFuture().onFailure(exception);
}
for (SubscriptionAction subscriptionAction : queuedSubscriptionInvocationList) {
subscriptionAction.fail(exception);
}
}
Aggregations