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
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.batch.retry;
Defines the basic set of operations implemented by RetryOperations to execute operations with configurable retry behaviour.

Author(s):
Rob Harrop
Dave Syer
public interface RetryOperations {

Execute the supplied RetryCallback with the configured retry semantics. See implementations for configuration details.

Returns:
the value returned by the RetryCallback upon successful invocation.
Throws:
java.lang.Exception any java.lang.Exception raised by the RetryCallback upon unsuccessful retry.
	<T> T execute(RetryCallback<T> retryCallbackthrows Exception;

Execute the supplied RetryCallback with a fallback on exhausted retry to the RecoveryCallback. See implementations for configuration details.

Returns:
the value returned by the RetryCallback upon successful invocation, and that returned by the RecoveryCallback otherwise.
Throws:
java.lang.Exception any java.lang.Exception raised by the RecoveryCallback upon unsuccessful retry.
	<T> T execute(RetryCallback<T> retryCallbackRecoveryCallback<T> recoveryCallbackthrows Exception;

A simple stateful retry. Execute the supplied RetryCallback with a target object for the attempt identified by the org.springframework.batch.retry.support.DefaultRetryState. Exceptions thrown by the callback are always propagated immediately so the state is required to be able to identify the previous attempt, if there is one - hence the state is required. Normal patterns would see this method being used inside a transaction, where the callback might invalidate the transaction if it fails.

See implementations for configuration details.

Returns:
the value returned by the RetryCallback upon successful invocation, and that returned by the RecoveryCallback otherwise.
Throws:
java.lang.Exception any java.lang.Exception raised by the RecoveryCallback.
ExhaustedRetryException if the last attempt for this state has already been reached
	<T> T execute(RetryCallback<T> retryCallbackRetryState retryStatethrows ExceptionExhaustedRetryException;

A stateful retry with a recovery path. Execute the supplied RetryCallback with a fallback on exhausted retry to the RecoveryCallback and a target object for the retry attempt identified by the org.springframework.batch.retry.support.DefaultRetryState.

Returns:
the value returned by the RetryCallback upon successful invocation, and that returned by the RecoveryCallback otherwise.
Throws:
java.lang.Exception any java.lang.Exception raised by the RecoveryCallback upon unsuccessful retry.
See also:
execute(org.springframework.batch.retry.RetryCallback,org.springframework.batch.retry.RetryState)
	<T> T execute(RetryCallback<T> retryCallbackRecoveryCallback<T> recoveryCallbackRetryState retryState)
			throws Exception;
New to GrepCode? Check out our FAQ X