モジュール spring.retry
クラス RetryInterceptorBuilder<T extends org.aopalliance.intercept.MethodInterceptor>
java.lang.ObjectSE
org.springframework.retry.interceptor.RetryInterceptorBuilder<T>
- 型パラメーター:
T- ビルダーのbuild()メソッドによって返されるMethodInterceptorの型。
- 既知の直属サブクラス
RetryInterceptorBuilder.CircuitBreakerInterceptorBuilder、RetryInterceptorBuilder.StatefulRetryInterceptorBuilder、RetryInterceptorBuilder.StatelessRetryInterceptorBuilder
public abstract class RetryInterceptorBuilder<T extends org.aopalliance.intercept.MethodInterceptor>
extends ObjectSE
エラー時の動作を定義するための流れるようなインターフェースを提供することで、StatefulRetryOperationsInterceptor または (ステートレスな) RetryOperationsInterceptor の構築をより簡単かつシンプルにするための簡素化されたファサード。
典型的な例:
StatefulRetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateful()
.maxAttempts(5).backOffOptions(1, 2, 10) // initialInterval, multiplier,
// maxInterval
.build();
- 導入:
- 1.1
- 作成者:
- James Carr, Gary Russell, Artem Bilan
ネストされたクラスの概要
ネストされたクラス修飾子と型クラス説明static classstatic classstatic classフィールド概要
フィールド修飾子と型フィールド説明protected StringSEprotected MethodInvocationRecoverer<?>protected RetryOperationsprotected final RetryTemplateprotected final SimpleRetryPolicy方法の概要
修飾子と型メソッド説明backOffOptions(long initialInterval, double multiplier, long maxInterval) バックオフオプションを適用します。backOffPolicy(BackOffPolicy policy) バックオフポリシーを適用します。abstract Tbuild()サーキットブレーカー再試行インターセプターのビルダーを作成します。maxAttempts(int maxAttempts) 最大試行回数を適用します - SimpleRetryPolicy が使用されます。recoverer(MethodInvocationRecoverer<?> recoverer) 再試行インターセプターにMethodInvocationRecovererを適用します。retryOperations(RetryOperations retryOperations) 再試行操作を適用します。これが設定されると、他のプロパティは設定できなくなります。他のプロパティが適用されている場合は設定できません。retryPolicy(RetryPolicy policy) 再試行ポリシーを適用する - カスタム再試行テンプレートが提供されている場合、または最大試行回数またはバックオフオプションまたはポリシーが適用されている場合は使用できません。stateful()ステートフルな再試行インターセプターのビルダーを作成します。ステートレス再試行インターセプターのビルダーを作成します。
フィールドの詳細
retryTemplate
simpleRetryPolicy
retryOperations
recoverer
label
方法の詳細
stateful
ステートフルな再試行インターセプターのビルダーを作成します。- 戻り値:
- インターセプタービルダー。
circuitBreaker
サーキットブレーカー再試行インターセプターのビルダーを作成します。- 戻り値:
- インターセプタービルダー。
stateless
ステートレス再試行インターセプターのビルダーを作成します。- 戻り値:
- インターセプタービルダー。
retryOperations
再試行操作を適用します。これが設定されると、他のプロパティは設定できなくなります。他のプロパティが適用されている場合は設定できません。- パラメーター:
retryOperations- 再試行操作。- 戻り値:
- this。
maxAttempts
最大試行回数を適用します - SimpleRetryPolicy が使用されます。カスタムの再試行操作または再試行ポリシーが設定されている場合は使用できません。- パラメーター:
maxAttempts- 最大試行回数(最初の試行回数を含む)。- 戻り値:
- this。
backOffOptions
public RetryInterceptorBuilder<T> backOffOptions(long initialInterval, double multiplier, long maxInterval) バックオフオプションを適用します。カスタムの再試行操作またはバックオフポリシーが設定されている場合は使用できません。- パラメーター:
initialInterval- 初期間隔。multiplier- 乗数。maxInterval- 最大間隔。- 戻り値:
- this。
retryPolicy
再試行ポリシーを適用する - カスタム再試行テンプレートが提供されている場合、または最大試行回数またはバックオフオプションまたはポリシーが適用されている場合は使用できません。- パラメーター:
policy- ポリシー。- 戻り値:
- this。
backOffPolicy
バックオフポリシーを適用します。カスタムの再試行操作またはバックオフポリシーが適用されている場合は使用できません。- パラメーター:
policy- ポリシー。- 戻り値:
- this。
recoverer
再試行インターセプターにMethodInvocationRecovererを適用します。- パラメーター:
recoverer- 回復者。- 戻り値:
- this。
label
build