public class CustomJsrJobOperator
extends org.springframework.batch.core.jsr.launch.JsrJobOperator
In the current implementation it's not possible to use an existing ApplicationContext as base context for the batch
job contexts.
Second reason is that we want to add listeners automatically to the job for having features like log file separation
and standard batch protocols.
That's why I patched it to add the functionality we need.
| Constructor and Description |
|---|
CustomJsrJobOperator(org.springframework.batch.core.explore.JobExplorer jobExplorer,
org.springframework.batch.core.repository.JobRepository jobRepository,
org.springframework.batch.core.converter.JobParametersConverter jobParametersConverter,
AddListenerToJobService addListenerToJobService,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) |
long |
start(String jobName,
Properties params) |
abandon, afterPropertiesSet, getJobExecution, getJobExecutions, getJobInstance, getJobInstanceCount, getJobInstances, getJobNames, getJobRestartProperties, getParameters, getRunningExecutions, getStepExecutions, getTaskExecutor, restart, setJobExplorer, setJobParametersConverter, setJobRepository, setTransactionManager, stoppublic CustomJsrJobOperator(org.springframework.batch.core.explore.JobExplorer jobExplorer,
org.springframework.batch.core.repository.JobRepository jobRepository,
org.springframework.batch.core.converter.JobParametersConverter jobParametersConverter,
AddListenerToJobService addListenerToJobService,
org.springframework.transaction.PlatformTransactionManager transactionManager)
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
setTaskExecutor in class org.springframework.batch.core.jsr.launch.JsrJobOperatorpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwaresetApplicationContext in class org.springframework.batch.core.jsr.launch.JsrJobOperatororg.springframework.beans.BeansExceptionpublic long start(String jobName, Properties params) throws javax.batch.operations.JobStartException, javax.batch.operations.JobSecurityException
start in interface javax.batch.operations.JobOperatorstart in class org.springframework.batch.core.jsr.launch.JsrJobOperatorjavax.batch.operations.JobStartExceptionjavax.batch.operations.JobSecurityExceptionCopyright © 2018 codecentric AG. All rights reserved.