@Override Object execute() { return getCommandAction().execute(getExecutionType()); } });
@Override Object execute() { MetaHolder metaHolder = commandAction.getMetaHolder(); Object[] args = toArgs(getCollapsedRequests()); args = createArgsForFallback(args, metaHolder, getExecutionException()); return commandAction.executeWithArgs(commandAction.getMetaHolder().getFallbackExecutionType(), args); } });
private FallbackErrorMessageBuilder commandAction(CommandAction action) { if (action instanceof CommandExecutionAction || action instanceof LazyCommandExecutionAction) { builder.append(": '").append(action.getActionName()).append("'. ") .append(action.getActionName()).append(" fallback is a hystrix command. "); } else if (action instanceof MethodExecutionAction) { builder.append(" is the method: '").append(action.getActionName()).append("'. "); } return this; }
@Override Object execute() { return getCommandAction().executeWithArgs(getExecutionType(), args); } });
@Override Object execute() { return getCommandAction().executeWithArgs(getExecutionType(), args); } });
@Override Object execute() { MetaHolder metaHolder = commandAction.getMetaHolder(); Object[] args = createArgsForFallback(metaHolder, getExecutionException()); return commandAction.executeWithArgs(metaHolder.getFallbackExecutionType(), args); } });
/** *{@inheritDoc}. */ @Override protected Observable construct() { Observable result; try { Observable observable = toObservable(commandActions.getCommandAction().execute(executionType)); result = observable .onErrorResumeNext(new Func1<Throwable, Observable>() { @Override public Observable call(Throwable throwable) { if (isIgnorable(throwable)) { return Observable.error(new HystrixBadRequestException(throwable.getMessage(), throwable)); } return Observable.error(throwable); } }); flushCache(); } catch (CommandActionExecutionException throwable) { Throwable cause = throwable.getCause(); if (isIgnorable(cause)) { throw new HystrixBadRequestException(cause.getMessage(), cause); } throw throwable; } return result; }
private FallbackErrorMessageBuilder commandAction(CommandAction action) { if (action instanceof CommandExecutionAction || action instanceof LazyCommandExecutionAction) { builder.append(": '").append(action.getActionName()).append("'. ") .append(action.getActionName()).append(" fallback is a hystrix command. "); } else if (action instanceof MethodExecutionAction) { builder.append(" is the method: '").append(action.getActionName()).append("'. "); } return this; }
protected Observable resumeWithFallback() { if (commandActions.hasFallbackAction()) { MetaHolder metaHolder = commandActions.getFallbackAction().getMetaHolder(); Throwable cause = getExecutionException(); if (cause instanceof CommandActionExecutionException) { Object res = commandActions.getFallbackAction().executeWithArgs(executionType, args); if (res instanceof Observable) { return (Observable) res;
@Override Object execute() { return getCommandAction().execute(getExecutionType()); } });
@Override Object execute() { MetaHolder metaHolder = commandAction.getMetaHolder(); Object[] args = toArgs(getCollapsedRequests()); args = createArgsForFallback(args, metaHolder, getExecutionException()); return commandAction.executeWithArgs(commandAction.getMetaHolder().getFallbackExecutionType(), args); } });
/** *{@inheritDoc}. */ @Override protected Observable construct() { Observable result; try { result = ((Observable) commandActions.getCommandAction().execute(executionType)) .onErrorResumeNext(new Func1<Throwable, Observable>() { @Override public Observable call(Throwable throwable) { if (isIgnorable(throwable)) { return Observable.error(new HystrixBadRequestException(throwable.getMessage(), throwable)); } return Observable.error(throwable); } }); flushCache(); } catch (CommandActionExecutionException throwable) { Throwable cause = throwable.getCause(); if (isIgnorable(cause)) { throw new HystrixBadRequestException(cause.getMessage(), cause); } throw throwable; } return result; }
@Override Object execute() { MetaHolder metaHolder = commandAction.getMetaHolder(); Object[] args = createArgsForFallback(metaHolder, getExecutionException()); return commandAction.executeWithArgs(metaHolder.getFallbackExecutionType(), args); } });
/** *{@inheritDoc}. */ @Override protected Observable resumeWithFallback() { if (commandActions.hasFallbackAction()) { MetaHolder metaHolder = commandActions.getFallbackAction().getMetaHolder(); Throwable cause = getExecutionException(); if (cause instanceof CommandActionExecutionException) { cause = cause.getCause(); } Object[] args = createArgsForFallback(metaHolder, cause); try { Object res = commandActions.getFallbackAction().executeWithArgs(executionType, args); if (res instanceof Observable) { return (Observable) res; } else { return Observable.just(res); } } catch (Exception e) { LOGGER.error(AbstractHystrixCommand.FallbackErrorMessageBuilder.create() .append(commandActions.getFallbackAction(), e).build()); throw new FallbackInvocationException(e.getCause()); } } return super.resumeWithFallback(); }