org.springframework.batch.retry
Interface RetryContext

All Superinterfaces:
AttributeAccessor
All Known Implementing Classes:
RetryContextSupport

public interface RetryContext
extends AttributeAccessor

Low-level access to ongoing retry operation. Normally not needed by clients, but can be used to alter the course of the retry, e.g. force an early termination.

Author:
Dave Syer

Method Summary
 Throwable getLastThrowable()
          Accessor for the exception object that caused the current retry.
 RetryContext getParent()
          Accessor for the parent context if retry blocks are nested.
 int getRetryCount()
          Counts the number of retry attempts.
 boolean isExhaustedOnly()
          Public accessor for the exhausted flag setExhaustedOnly().
 void setExhaustedOnly()
          Signal to the framework that no more attempts should be made to try or retry the current RetryCallback.
 
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
 

Method Detail

setExhaustedOnly

void setExhaustedOnly()
Signal to the framework that no more attempts should be made to try or retry the current RetryCallback.


isExhaustedOnly

boolean isExhaustedOnly()
Public accessor for the exhausted flag setExhaustedOnly().

Returns:
true if the flag has been set.

getParent

RetryContext getParent()
Accessor for the parent context if retry blocks are nested.

Returns:
the parent or null if there is none.

getRetryCount

int getRetryCount()
Counts the number of retry attempts. Before the first attempt this counter is zero, and before the first and subsequent attempts it should increment accordingly.

Returns:
the number of retries.

getLastThrowable

Throwable getLastThrowable()
Accessor for the exception object that caused the current retry.

Returns:
the last exception that caused a retry, or possibly null. It will be null if this is the first attempt, but also if the enclosing policy decides not to provide it (e.g. because of concerns about memory usage).


Copyright © 2009 SpringSource. All Rights Reserved.