public abstract class AbstractProcessBuilderTasklet
extends java.lang.Object
implements org.springframework.batch.core.step.tasklet.Tasklet, org.springframework.context.EnvironmentAware, org.springframework.batch.core.StepExecutionListener
Modifier and Type | Field and Description |
---|---|
protected org.springframework.core.env.ConfigurableEnvironment |
environment |
protected int |
exitCode
Exit code of job
|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
AbstractProcessBuilderTasklet() |
Modifier and Type | Method and Description |
---|---|
void |
addEnvironmentProvider(EnvironmentProvider environmentProvider) |
org.springframework.batch.core.ExitStatus |
afterStep(org.springframework.batch.core.StepExecution stepExecution) |
void |
beforeStep(org.springframework.batch.core.StepExecution stepExecution) |
protected abstract java.util.List<java.lang.String> |
createCommand() |
org.springframework.batch.repeat.RepeatStatus |
execute(org.springframework.batch.core.StepContribution contribution,
org.springframework.batch.core.scope.context.ChunkContext chunkContext) |
protected abstract java.lang.String |
getCommandDescription() |
protected abstract java.lang.String |
getCommandDisplayString() |
protected abstract java.lang.String |
getCommandName() |
protected java.lang.String |
getFirstExceptionMessage(java.util.List<java.lang.String> out,
java.util.List<java.lang.String> err) |
protected java.util.List<java.lang.String> |
getProcessOutput(java.io.File f) |
protected abstract boolean |
isStoppable() |
protected void |
printLog(java.lang.String commandName,
java.util.List<java.lang.String> out,
java.util.List<java.lang.String> err) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
void |
setJobExplorer(org.springframework.batch.core.explore.JobExplorer jobExplorer) |
void |
setSystemProcessExitCodeMapper(org.springframework.batch.core.step.tasklet.SystemProcessExitCodeMapper systemProcessExitCodeMapper) |
void |
setTerminationCheckInterval(long checkInterval)
The time interval how often the tasklet will check for termination
status.
|
protected final org.slf4j.Logger logger
protected org.springframework.core.env.ConfigurableEnvironment environment
protected int exitCode
public void setEnvironment(org.springframework.core.env.Environment environment)
setEnvironment
in interface org.springframework.context.EnvironmentAware
public void addEnvironmentProvider(EnvironmentProvider environmentProvider)
public org.springframework.batch.repeat.RepeatStatus execute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext) throws java.lang.Exception
execute
in interface org.springframework.batch.core.step.tasklet.Tasklet
java.lang.Exception
public void beforeStep(org.springframework.batch.core.StepExecution stepExecution)
beforeStep
in interface org.springframework.batch.core.StepExecutionListener
public org.springframework.batch.core.ExitStatus afterStep(org.springframework.batch.core.StepExecution stepExecution)
afterStep
in interface org.springframework.batch.core.StepExecutionListener
protected abstract boolean isStoppable()
protected abstract java.util.List<java.lang.String> createCommand() throws java.lang.Exception
java.lang.Exception
protected abstract java.lang.String getCommandDisplayString()
protected abstract java.lang.String getCommandName()
protected abstract java.lang.String getCommandDescription()
protected java.util.List<java.lang.String> getProcessOutput(java.io.File f)
protected void printLog(java.lang.String commandName, java.util.List<java.lang.String> out, java.util.List<java.lang.String> err)
protected java.lang.String getFirstExceptionMessage(java.util.List<java.lang.String> out, java.util.List<java.lang.String> err)
public void setJobExplorer(org.springframework.batch.core.explore.JobExplorer jobExplorer)
public void setSystemProcessExitCodeMapper(org.springframework.batch.core.step.tasklet.SystemProcessExitCodeMapper systemProcessExitCodeMapper)
systemProcessExitCodeMapper
- maps system process return value to
ExitStatus
returned by Tasklet.
SimpleSystemProcessExitCodeMapper
is used by default.public void setTerminationCheckInterval(long checkInterval)
checkInterval
- time interval in milliseconds (1 second by default).