クラス JobLauncherApplicationRunner
java.lang.ObjectSE
org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner
- 実装されているすべてのインターフェース:
Aware、InitializingBean、ApplicationRunner、ApplicationEventPublisherAware、Ordered
public class JobLauncherApplicationRunner
extends ObjectSE
implements ApplicationRunner, InitializingBean, Ordered, ApplicationEventPublisherAware
ApplicationRunner から launch、Spring Batch のジョブ。コンテキスト内に 1 つのジョブが見つかった場合、デフォルトでそのジョブが実行されます。複数のジョブが見つかった場合は、jobName を指定して特定のジョブを起動します。- 導入:
- 2.3.0
- 作成者:
- Dave Syer, Jean-Pierre Bergamin, Mahmoud Ben Hassine, Stephane Nicoll, Akshay Dubey
フィールドのサマリー
フィールドインターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクターの概要
コンストラクターコンストラクター説明JobLauncherApplicationRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository) 新しいJobLauncherApplicationRunnerを作成します。メソッドのサマリー
修飾子と型メソッド説明voidprotected voidexecute(org.springframework.batch.core.Job job, org.springframework.batch.core.JobParameters jobParameters) intgetOrder()protected voidlaunchJobFromProperties(PropertiesSE properties) voidvoidrun(ApplicationArguments args) Bean の実行に使用されるコールバック。voidvoidsetJobName(StringSE jobName) voidsetJobParametersConverter(org.springframework.batch.core.converter.JobParametersConverter converter) voidsetJobRegistry(org.springframework.batch.core.configuration.JobRegistry jobRegistry) voidsetJobs(CollectionSE<org.springframework.batch.core.Job> jobs) voidsetOrder(int order) voidvalidate()非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
フィールドの詳細
DEFAULT_ORDER
public static final int DEFAULT_ORDERコマンドラインランナーのデフォルトの順序。- 関連事項:
コンストラクターの詳細
JobLauncherApplicationRunner
public JobLauncherApplicationRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository) 新しいJobLauncherApplicationRunnerを作成します。- パラメーター:
jobLauncher- ジョブを始めるjobExplorer- 以前の実行についてジョブリポジトリを確認するjobRepository- ジョブの実行時に、指定されたパラメーターでジョブインスタンスが存在するかどうかを確認する
メソッドの詳細
afterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
InitializingBeanのafterPropertiesSet
validate
非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。setOrder
public void setOrder(int order) getOrder
public int getOrder()setApplicationEventPublisher
- 次で指定:
- インターフェース
ApplicationEventPublisherAwareのsetApplicationEventPublisher
setJobRegistry
@Autowired(required=false) public void setJobRegistry(org.springframework.batch.core.configuration.JobRegistry jobRegistry) setJobName
setJobParametersConverter
@Autowired(required=false) public void setJobParametersConverter(org.springframework.batch.core.converter.JobParametersConverter converter) setJobs
@Autowired(required=false) public void setJobs(CollectionSE<org.springframework.batch.core.Job> jobs) run
インターフェースからコピーされた説明:ApplicationRunnerBean の実行に使用されるコールバック。- 次で指定:
- インターフェース
ApplicationRunnerのrun - パラメーター:
args- 受信アプリケーション引数- 例外:
ExceptionSE- エラー時
run
- 例外:
org.springframework.batch.core.JobExecutionException
launchJobFromProperties
protected void launchJobFromProperties(PropertiesSE properties) throws org.springframework.batch.core.JobExecutionException - 例外:
org.springframework.batch.core.JobExecutionException
execute
protected void execute(org.springframework.batch.core.Job job, org.springframework.batch.core.JobParameters jobParameters) throws org.springframework.batch.core.repository.JobExecutionAlreadyRunningException, org.springframework.batch.core.repository.JobRestartException, org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException, org.springframework.batch.core.JobParametersInvalidException - 例外:
org.springframework.batch.core.repository.JobExecutionAlreadyRunningExceptionorg.springframework.batch.core.repository.JobRestartExceptionorg.springframework.batch.core.repository.JobInstanceAlreadyCompleteExceptionorg.springframework.batch.core.JobParametersInvalidException