private boolean isRecovered(RetryContext context) { return context.hasAttribute(RetryContext.RECOVERED); }
private boolean isGlobal(RetryContext context) { return context.hasAttribute("state.global"); }
private boolean isExhausted(RetryContext context) { return context.hasAttribute(RetryContext.EXHAUSTED); }
private boolean isClosed(RetryContext context) { return context.hasAttribute(RetryContext.CLOSED); }
private boolean hasState(RetryContext context) { return context.hasAttribute(RetryContext.STATE_KEY); }
private RetryContext doOpenInternal(RetryPolicy retryPolicy, RetryState state) { RetryContext context = retryPolicy.open(RetrySynchronizationManager.getContext()); if (state != null) { context.setAttribute(RetryContext.STATE_KEY, state.getKey()); } if (context.hasAttribute(GLOBAL_STATE)) { registerContext(context, state); } return context; }
/** * Clean up the cache if necessary and close the context provided (if the flag * indicates that processing was successful). * * @param retryPolicy the {@link RetryPolicy} * @param context the {@link RetryContext} * @param state the {@link RetryState} * @param succeeded whether the close succeeded */ protected void close(RetryPolicy retryPolicy, RetryContext context, RetryState state, boolean succeeded) { if (state != null) { if (succeeded) { if (!context.hasAttribute(GLOBAL_STATE)) { this.retryContextCache.remove(state.getKey()); } retryPolicy.close(context); context.setAttribute(RetryContext.CLOSED, true); } } else { retryPolicy.close(context); context.setAttribute(RetryContext.CLOSED, true); } }
RetryContext context, RetryState state) throws Throwable { context.setAttribute(RetryContext.EXHAUSTED, true); if (state != null && !context.hasAttribute(GLOBAL_STATE)) { this.retryContextCache.remove(state.getKey());
if (state != null && context.hasAttribute(GLOBAL_STATE)) { break;
for (String key : new String[] { CircuitBreakerRetryPolicy.CIRCUIT_OPEN, CircuitBreakerRetryPolicy.CIRCUIT_SHORT_COUNT }) { if (context.hasAttribute(key)) { accessor.setAttribute(key, context.getAttribute(key));
private boolean hasState(RetryContext context) { return context.hasAttribute(RetryContext.STATE_KEY); }
private boolean isGlobal(RetryContext context) { return context.hasAttribute("state.global"); }
private boolean isClosed(RetryContext context) { return context.hasAttribute(RetryContext.CLOSED); }
private boolean isExhausted(RetryContext context) { return context.hasAttribute(RetryContext.EXHAUSTED); }
private boolean isRecovered(RetryContext context) { return context.hasAttribute(RetryContext.RECOVERED); }
private RetryContext doOpenInternal(RetryPolicy retryPolicy, RetryState state) { RetryContext context = retryPolicy.open(RetrySynchronizationManager.getContext()); if (state != null) { context.setAttribute(RetryContext.STATE_KEY, state.getKey()); } if (context.hasAttribute(GLOBAL_STATE)) { registerContext(context, state); } return context; }
RetryContext context, RetryState state) throws Throwable { context.setAttribute(RetryContext.EXHAUSTED, true); if (state != null && !context.hasAttribute(GLOBAL_STATE)) { this.retryContextCache.remove(state.getKey());
/** * Clean up the cache if necessary and close the context provided (if the flag * indicates that processing was successful). * * @param retryPolicy the {@link RetryPolicy} * @param context the {@link RetryContext} * @param state the {@link RetryState} * @param succeeded whether the close succeeded */ protected void close(RetryPolicy retryPolicy, RetryContext context, RetryState state, boolean succeeded) { if (state != null) { if (succeeded) { if (!context.hasAttribute(GLOBAL_STATE)) { this.retryContextCache.remove(state.getKey()); } retryPolicy.close(context); context.setAttribute(RetryContext.CLOSED, true); } } else { retryPolicy.close(context); context.setAttribute(RetryContext.CLOSED, true); } }
if (state != null && context.hasAttribute(GLOBAL_STATE)) { break;
for (String key : new String[] { CircuitBreakerRetryPolicy.CIRCUIT_OPEN, CircuitBreakerRetryPolicy.CIRCUIT_SHORT_COUNT }) { if (context.hasAttribute(key)) { accessor.setAttribute(key, context.getAttribute(key));