see cref="ITasklet"/>that executes a system command. The system command is executed asynchronously using injected ITaskExecutor - timeout value is required to be set, so that the batch job does not hang forever if the external process hangs. Tasklet periodically checks for termination status (i.e. Command finished its execution or timeout expired or job was interrupted). The check interval is given by TerminationCheckInterval. When job interrupt is detected tasklet's execution is terminated immediately by throwing JobInterruptedException. More...
Public Member Functions | |
void | AfterPropertiesSet () |
void | Stop () |
IStoppableTasklet::Stop. More... | |
RepeatStatus | Execute (StepContribution contribution, Scope.Context.ChunkContext chunkContext) |
Execute system command and map its exit code to ExitStatus using SystemProcessExitCodeMapper. More... | |
override void | BeforeStep (StepExecution stepExecution) |
Public Member Functions inherited from Summer.Batch.Core.Listener.StepExecutionListenerSupport | |
virtual ExitStatus | AfterStep (StepExecution stepExecution) |
Public Member Functions inherited from Summer.Batch.Core.Step.Tasklet.ITasklet | |
RepeatStatus | Execute (StepContribution contribution, ChunkContext chunkContext) |
Given the current context in the form of a step contribution, do whatever is necessary to process this unit inside a transaction. Implementations return RepeatStatus::Finished if finished. If not they return RepeatStatus::Continuable. On failure throws an exception. More... | |
Static Protected Attributes | |
static readonly Logger | Logger = LogManager.GetCurrentClassLogger() |
Logger. More... | |
Properties | |
string | Command [set] |
(System) Command property. More... | |
string[] | EnvironmentParams [set] |
Environment Params More... | |
string | WorkingDirectory [set] |
Working directory property. More... | |
ISystemProcessExitCodeMapper | SystemProcessExitCodeMapper [set] |
System process exit code mapper property. More... | |
long | Timeout [set] |
Timeout property. More... | |
long | TerminationCheckInterval [set] |
Termination check interval property. More... | |
ITaskExecutor | TaskExecutor [set] |
Task executor property. More... | |
IJobExplorer | JobExplorer [set] |
Job explorer property. More... | |
Detailed Description
see cref="ITasklet"/>that executes a system command. The system command is executed asynchronously using injected ITaskExecutor - timeout value is required to be set, so that the batch job does not hang forever if the external process hangs. Tasklet periodically checks for termination status (i.e. Command finished its execution or timeout expired or job was interrupted). The check interval is given by TerminationCheckInterval. When job interrupt is detected tasklet's execution is terminated immediately by throwing JobInterruptedException.
NOTE : InterruptOnCancel is not being supported for now.
Member Function Documentation
void Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.AfterPropertiesSet | ( | ) |
- See also
- IInitializationPostOperations::AfterPropertiesSet.
Implements Summer.Batch.Common.Factory.IInitializationPostOperations.
|
virtual |
- See also
- IStepExecutionListener::BeforeStep.
- Parameters
-
stepExecution
Reimplemented from Summer.Batch.Core.Listener.StepExecutionListenerSupport.
RepeatStatus Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.Execute | ( | StepContribution | contribution, |
Scope.Context.ChunkContext | chunkContext | ||
) |
Execute system command and map its exit code to ExitStatus using SystemProcessExitCodeMapper.
- Parameters
-
contribution chunkContext
- Returns
void Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.Stop | ( | ) |
Member Data Documentation
|
staticprotected |
Logger.
Property Documentation
|
set |
(System) Command property.
|
set |
Environment Params
|
set |
Job explorer property.
|
set |
System process exit code mapper property.
|
set |
Task executor property.
|
set |
Termination check interval property.
|
set |
Timeout property.
|
set |
Working directory property.
The documentation for this class was generated from the following file:
- Summer.Batch.Core/Core/Step/Tasklet/SystemCommandTasklet.cs