C# Class Spring.Retry.Retry.Policy.SimpleRetryPolicy

Simple retry policy that retries a fixed number of times for a set of named exceptions (and subclasses). The number of attempts includes the initial try, so e.g. retryTemplate = new RetryTemplate(new SimpleRetryPolicy(3)); retryTemplate.Execute(callback); will execute the callback at least once, and as many as 3 times.
Inheritance: IRetryPolicy
ファイルを表示 Open project: spring-projects/spring-net-retry

Public Properties

Property Type Description
DEFAULT_MAX_ATTEMPTS int

Public Methods

Method Description
CanRetry ( IRetryContext context ) : bool

Test for retryable operation based on the status.

Close ( IRetryContext context ) : void

The close.

Open ( IRetryContext parent ) : IRetryContext

Get a status object that can be used to track the current operation according to this policy. Has to be aware of the latest exception and the number of attempts.

RegisterException ( IRetryContext context, Exception exception ) : void

Update the status with another attempted retry and the latest exception.

SimpleRetryPolicy ( ) : System

Initializes a new instance of the SimpleRetryPolicy class.

SimpleRetryPolicy ( int maxAttempts, bool>.IDictionary retryableExceptions ) : System

Initializes a new instance of the SimpleRetryPolicy class.

ToString ( ) : string

The to string.

Private Methods

Method Description
RetryForException ( Exception ex ) : bool

Delegates to an exception classifier.

Method Details

CanRetry() public method

Test for retryable operation based on the status.
public CanRetry ( IRetryContext context ) : bool
context IRetryContext The context.
return bool

Close() public method

The close.
public Close ( IRetryContext context ) : void
context IRetryContext The context.
return void

Open() public method

Get a status object that can be used to track the current operation according to this policy. Has to be aware of the latest exception and the number of attempts.
public Open ( IRetryContext parent ) : IRetryContext
parent IRetryContext The parent.
return IRetryContext

RegisterException() public method

Update the status with another attempted retry and the latest exception.
public RegisterException ( IRetryContext context, Exception exception ) : void
context IRetryContext The context.
exception System.Exception The throwable.
return void

SimpleRetryPolicy() public method

Initializes a new instance of the SimpleRetryPolicy class.
public SimpleRetryPolicy ( ) : System
return System

SimpleRetryPolicy() public method

Initializes a new instance of the SimpleRetryPolicy class.
public SimpleRetryPolicy ( int maxAttempts, bool>.IDictionary retryableExceptions ) : System
maxAttempts int The max attempts.
retryableExceptions bool>.IDictionary The retryable exceptions.
return System

ToString() public method

The to string.
public ToString ( ) : string
return string

Property Details

DEFAULT_MAX_ATTEMPTS public_oe static_oe property

public static int DEFAULT_MAX_ATTEMPTS
return int