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;
22 public abstract class InvocationListener<Q, R, E> {
48 public static class Composer<Q, R, E>
extends InvocationListener<Q, R, E>{
49 private static Logger log = LoggerFactory.getLogger(Composer.class);
51 private List<InvocationListener<Q, R, E>> listeners;
54 this.listeners = listeners;
58 return new Composer<Q, R, E>(listeners);
65 listener.onStart(invocationInfo);
66 }
catch (RuntimeException ex){
67 log.error(
"Failed to call onStart in {} listener-invocation", listener.toString(), ex);
76 listener.onSuccess(invocationInfo);
77 }
catch (RuntimeException ex){
78 log.error(
"Failed to call onSuccess in {} listener-invocation", listener.toString(), ex);
87 listener.onFail(invocationInfo, e);
88 }
catch (RuntimeException ex){
89 log.error(
"Failed to call onFail in {} listener-invocation", listener.toString(), ex);
98 listener.onError(invocationInfo, error);
99 }
catch (RuntimeException ex){
100 log.error(
"Failed to call onError in {} listener-invocation", listener.toString(), ex);