public class RethrowOnThresholdExceptionHandler extends java.lang.Object implements ExceptionHandler
ExceptionHandler
の実装。例外型を一意のキーにマップする Classifier
と、それらのキーからしきい値(整数型)にマップする必要があります。修飾子と型 | フィールドと説明 |
---|---|
protected org.apache.commons.logging.Log | logger |
protected static org.springframework.batch.repeat.exception.RethrowOnThresholdExceptionHandler.IntegerHolder | ZERO |
コンストラクターと説明 |
---|
RethrowOnThresholdExceptionHandler() 例外ハンドラーを設定します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | handleException(RepeatContext context, java.lang.Throwable throwable) スローアブルを分類し、結果に基づいて再スローするかどうかを決定します。 |
void | setThresholds(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,java.lang.Integer> thresholds) 例外クラスから整数型のしきい値へのマップ。 |
void | setUseParent(boolean useParent) ネストされたバッチ内の兄弟コンテキスト間で例外カウンターを共有する必要があることを示すフラグ。 |
protected static final org.springframework.batch.repeat.exception.RethrowOnThresholdExceptionHandler.IntegerHolder ZERO
protected final org.apache.commons.logging.Log logger
public RethrowOnThresholdExceptionHandler()
public void setUseParent(boolean useParent)
useParent
- 親コンテキストを使用してカウンターを格納する必要がある場合は true。public void setThresholds(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,java.lang.Integer> thresholds)
thresholds
- しきい値マップ。public void handleException(RepeatContext context, java.lang.Throwable throwable) throws java.lang.Throwable
ExceptionHandler
の handleException
context
- 現在の RepeatContext
特定の例外型の発生回数をカウントし、しきい値ポリシーを実装するなど、状態を(属性を介して)保存するために使用できます。throwable
- 例外。java.lang.Throwable
- 例外の数がしきい値を超えるとスローされます。ExceptionHandler.handleException(RepeatContext, Throwable)