Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2006-2007 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.springframework.batch.retry.context;
public class RetryContextSupport extends AttributeAccessorSupport implements RetryContext {
	private boolean terminate = false;
	private int count;
	public RetryContextSupport(RetryContext parent) {
		this. = parent;
	public RetryContext getParent() {
		return this.;
	public boolean isExhaustedOnly() {
		return ;
	public void setExhaustedOnly() {
		 = true;
	public int getRetryCount() {
		return ;
		return ;

Set the exception for the public interface org.springframework.batch.retry.RetryContext, and also increment the retry count if the throwable is non-null.
All org.springframework.batch.retry.RetryPolicy implementations should use this method when they register the throwable. It should only be called once per retry attempt because it increments a counter.
Use of this method is not enforced by the framework - it is a service provider contract for authors of policies.

throwable the exception that caused the current retry attempt to fail.
	public void registerThrowable(Throwable throwable) {
		this. = throwable;
		if (throwable != null)
	public String toString() {
		return String.format("[RetryContext: count=%d, lastException=%s, exhausted=%b]");
New to GrepCode? Check out our FAQ X