@Override public void close(RetryContext context) { CircuitBreakerRetryContext circuit = (CircuitBreakerRetryContext) context; this.delegate.close(circuit.context); }
/** * Delegate to the policy currently activated in the context. * * @see org.springframework.retry.RetryPolicy#close(org.springframework.retry.RetryContext) */ public void close(RetryContext context) { RetryPolicy policy = (RetryPolicy) context; policy.close(context); }
/** * Delegate to the policies that were in operation when the context was * created. If any of them fails to close the exception is propagated (and * those later in the chain are closed before re-throwing). * * @see org.springframework.retry.RetryPolicy#close(org.springframework.retry.RetryContext) * @param context the {@link RetryContext} */ @Override public void close(RetryContext context) { RetryContext[] contexts = ((CompositeRetryContext) context).contexts; RetryPolicy[] policies = ((CompositeRetryContext) context).policies; RuntimeException exception = null; for (int i = 0; i < contexts.length; i++) { try { policies[i].close(contexts[i]); } catch (RuntimeException e) { if (exception == null) { exception = e; } } } if (exception != null) { throw exception; } }
public void close(RetryContext context) { // Only close those policies that have been used (opened): for (RetryPolicy policy : contexts.keySet()) { policy.close(getContext(policy, context.getParent())); } }
/** * 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); } }
/** * {@inheritDoc} */ @Override public void close(RetryContext context) { delegate.close(context); }
@Override public void close(RetryContext context) { delegate.close(context); }
@Override public void close(RetryContext context) { CircuitBreakerRetryContext circuit = (CircuitBreakerRetryContext) context; this.delegate.close(circuit.context); }
/** * Delegate to the policy currently activated in the context. * * @see org.springframework.retry.RetryPolicy#close(org.springframework.retry.RetryContext) */ public void close(RetryContext context) { RetryPolicy policy = (RetryPolicy) context; policy.close(context); }
@Override public void close(RetryContext context) { delegate.close(context); }
/** * {@inheritDoc} */ @Override public void close(RetryContext context) { delegate.close(context); }
/** * Delegate to the policies that were in operation when the context was * created. If any of them fails to close the exception is propagated (and * those later in the chain are closed before re-throwing). * * @see org.springframework.retry.RetryPolicy#close(org.springframework.retry.RetryContext) * @param context the {@link RetryContext} */ @Override public void close(RetryContext context) { RetryContext[] contexts = ((CompositeRetryContext) context).contexts; RetryPolicy[] policies = ((CompositeRetryContext) context).policies; RuntimeException exception = null; for (int i = 0; i < contexts.length; i++) { try { policies[i].close(contexts[i]); } catch (RuntimeException e) { if (exception == null) { exception = e; } } } if (exception != null) { throw exception; } }
public void close(RetryContext context) { // Only close those policies that have been used (opened): for (RetryPolicy policy : contexts.keySet()) { policy.close(getContext(policy, context.getParent())); } }
/** * 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); } }