/** * Wrap the given {@code delegate} in an InvocationHandler that returns null when the * {@code delegate} throws a TimeoutException. * * @param delegate The delegate to invoke, potentially throwing a TimeoutException when invoked * @param <R> The response type of the command handler * @return an InvocationHandler that wraps returns null when a TimeoutException is thrown */ protected <R> InvocationHandler<R> wrapToReturnNullOnTimeout(final InvocationHandler<R> delegate) { return new NullOnTimeout<>(delegate); }
/** * Wrap the given {@code delegate} in an InvocationHandler that returns null when the * {@code delegate} throws a TimeoutException. * * @param delegate The delegate to invoke, potentially throwing a TimeoutException when invoked * @param <R> The response type of the command handler * @return an InvocationHandler that wraps returns null when a TimeoutException is thrown */ protected <R> InvocationHandler<R> wrapToReturnNullOnTimeout(final InvocationHandler<R> delegate) { return new NullOnTimeout<>(delegate); }
/** * Wrap the given {@code delegate} in an InvocationHandler that returns null when the * {@code delegate} throws a TimeoutException. * * @param delegate The delegate to invoke, potentially throwing a TimeoutException when invoked * @param <R> The response type of the command handler * @return an InvocationHandler that wraps returns null when a TimeoutException is thrown */ protected <R> InvocationHandler<R> wrapToReturnNullOnTimeout(final InvocationHandler<R> delegate) { return new NullOnTimeout<>(delegate); }