1 package com.griddynamics.jagger.engine.e1.collector.invocation;
3 import com.griddynamics.jagger.invoker.InvocationException;
4 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory;
21 public abstract class InvocationListener<Q, R, E> {
47 public static class Composer<Q, R, E>
extends InvocationListener<Q, R, E>{
48 private static Logger log = LoggerFactory.getLogger(Composer.class);
50 private List<InvocationListener<Q, R, E>> listeners;
53 this.listeners = listeners;
57 return new Composer<Q, R, E>(listeners);
64 listener.onStart(invocationInfo);
65 }
catch (RuntimeException ex){
66 log.error(
"Failed to call onStart in {} listener-invocation", listener.toString(), ex);
75 listener.onSuccess(invocationInfo);
76 }
catch (RuntimeException ex){
77 log.error(
"Failed to call onSuccess in {} listener-invocation", listener.toString(), ex);
86 listener.onFail(invocationInfo, e);
87 }
catch (RuntimeException ex){
88 log.error(
"Failed to call onFail in {} listener-invocation", listener.toString(), ex);
97 listener.onError(invocationInfo, error);
98 }
catch (RuntimeException ex){
99 log.error(
"Failed to call onError in {} listener-invocation", listener.toString(), ex);