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