@Override public CopycatException createException() { return new CommandException("failed to obtain write quorum"); } },
@Override protected Throwable defaultException() { return new CommandException("failed to complete command"); }
@Override public CopycatException createException() { return new CommandException("failed to obtain write quorum"); } },
@Override public CopycatException createException() { return new CommandException("failed to obtain write quorum"); } },
@Override protected Throwable defaultException() { return new CommandException("failed to complete command"); }
@Override protected Throwable defaultException() { return new CommandException("failed to complete command"); }
/** * Wraps a void method. */ private Consumer wrapVoidMethod(Method method) { return c -> { try { method.invoke(this, c); } catch (InvocationTargetException e) { throw new CommandException(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } }; }
/** * Wraps a value method. */ private Function wrapValueMethod(Method method) { return c -> { try { return method.invoke(this, c); } catch (InvocationTargetException e) { throw new CommandException(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } }; }
/** * Wraps a void method. */ private Consumer wrapVoidMethod(Method method) { return c -> { try { method.invoke(this, c); } catch (InvocationTargetException e) { throw new CommandException(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } }; }
/** * Wraps a value method. */ private Function wrapValueMethod(Method method) { return c -> { try { return method.invoke(this, c); } catch (InvocationTargetException e) { throw new CommandException(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } }; }
/** * Wraps a void method. */ private Consumer wrapVoidMethod(Method method) { return c -> { try { method.invoke(this, c); } catch (InvocationTargetException e) { throw new CommandException(e.getCause()); } catch (IllegalAccessException e) { throw new AssertionError(e); } }; }