private <A extends Action<R>, R extends Result> void doUndo(A action, R result, ExecutionContext ctx) throws ActionException, ServiceException { ActionValidator actionValidator = findActionValidator(action); ActionHandler<A, R> handler = findHandler(action); try { if (actionValidator.isValid(action)) { handler.undo(action, result, ctx); } else { throw new ServiceException(actionValidator.getClass().getName() + actionValidatorMessage + action .getClass().getName()); } } catch (ActionException e) { throw e; } catch (Exception cause) { throw new ServiceException(cause); } }
private <A extends Action<R>, R extends Result> void doUndo(A action, R result, ExecutionContext ctx) throws ActionException, ServiceException { ActionValidator actionValidator = findActionValidator(action); ActionHandler<A, R> handler = findHandler(action); try { if (actionValidator.isValid(action)) { handler.undo(action, result, ctx); } else { throw new ServiceException(actionValidator.getClass().getName() + actionValidatorMessage + action .getClass().getName()); } } catch (ActionException e) { throw e; } catch (Exception cause) { throw new ServiceException(cause); } }