クラス SimpleStepHandler
java.lang.ObjectSE
org.springframework.batch.core.job.SimpleStepHandler
- 実装済みのインターフェース一覧:
StepHandler,org.springframework.beans.factory.InitializingBean
public class SimpleStepHandler
extends ObjectSE
implements StepHandler, org.springframework.beans.factory.InitializingBean
リポジトリを管理し、関心事を再起動する
StepHandler の実装。- 作成者:
- Dave Syer
コンストラクター概要
コンストラクターコンストラクター説明構成を使用するための便利なデフォルトコンストラクター。SimpleStepHandler(JobRepository jobRepository) SimpleStepHandler(JobRepository jobRepository, ExecutionContext executionContext) 方法の概要
修飾子と型メソッド説明void必須プロパティ (jobRepository) を確認します。protected JobRepositoryhandleStep(Step step, JobExecution execution) ステップを処理し、その実行を返します。voidsetExecutionContext(ExecutionContext executionContext) 処理される前にステップ実行に追加される値を含むコンテキスト。voidsetJobRepository(JobRepository jobRepository) protected booleanshouldStart(StepExecution lastStepExecution, JobExecution jobExecution, Step step) ステップと構成を指定して、ステップを開始する必要がある場合は true を返し、開始しない場合は false を返し、ジョブを終了する必要がある場合は例外をスローします。
コンストラクターの詳細
SimpleStepHandler
public SimpleStepHandler()構成を使用するための便利なデフォルトコンストラクター。SimpleStepHandler
- パラメーター:
jobRepository-JobRepository
SimpleStepHandler
- パラメーター:
jobRepository-JobRepositoryexecutionContext- 現在のステップのExecutionContext
方法の詳細
afterPropertiesSet
必須プロパティ (jobRepository) を確認します。- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBean内のafterPropertiesSet - 例外:
ExceptionSE- 関連事項:
InitializingBean.afterPropertiesSet()
getJobRepository
- 戻り値:
- 中古 jobRepository
setJobRepository
- パラメーター:
jobRepository- 設定する jobRepository
setExecutionContext
処理される前にステップ実行に追加される値を含むコンテキスト。- パラメーター:
executionContext- 設定する実行コンテキスト
handleStep
public StepExecution handleStep(Step step, JobExecution execution) throws JobInterruptedException, JobRestartException, StartLimitExceededException インターフェースからコピーされた説明:StepHandlerステップを処理し、その実行を返します。JobExecutionは保存されませんが、必要に応じてStepExecutionの永続性を管理する必要があります(たとえば、ステップを実行する前に、少なくともリポジトリに追加する必要があります)。- 次で指定:
- インターフェース
StepHandler内のhandleStep - パラメーター:
step-Stepexecution-JobExecution- 戻り値:
- ステップの実行
- 例外:
JobInterruptedException- 中断がある場合JobRestartException- 失敗したステップの再開に問題がある場合StartLimitExceededException- ステップが開始制限を超えた場合- 関連事項:
shouldStart
protected boolean shouldStart(StepExecution lastStepExecution, JobExecution jobExecution, Step step) throws JobRestartException, StartLimitExceededException ステップと構成を指定して、ステップを開始する必要がある場合は true を返し、開始しない場合は false を返し、ジョブを終了する必要がある場合は例外をスローします。- パラメーター:
lastStepExecution- 最後のステップの実行jobExecution- 評価されるJobExecutionインスタンス。step- 評価されるStepインスタンス。- 戻り値:
- ステップを開始する必要がある場合は true、開始しない場合は false。
- 例外:
StartLimitExceededException- このステップの開始制限を超えている場合JobRestartException- ジョブが以前の失敗と矛盾した状態にある場合