Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet Class Reference

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...

Inheritance diagram for Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet:
Summer.Batch.Core.Listener.StepExecutionListenerSupport Summer.Batch.Core.Step.Tasklet.IStoppableTasklet Summer.Batch.Common.Factory.IInitializationPostOperations Summer.Batch.Core.IStepExecutionListener Summer.Batch.Core.Step.Tasklet.ITasklet Summer.Batch.Core.IStepListener

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.

override void Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.BeforeStep ( StepExecution  stepExecution)
virtual
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

readonly Logger Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.Logger = LogManager.GetCurrentClassLogger()
staticprotected

Logger.

Property Documentation

string Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.Command
set

(System) Command property.

string [] Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.EnvironmentParams
set

Environment Params

IJobExplorer Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.JobExplorer
set

Job explorer property.

ISystemProcessExitCodeMapper Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.SystemProcessExitCodeMapper
set

System process exit code mapper property.

ITaskExecutor Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.TaskExecutor
set

Task executor property.

long Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.TerminationCheckInterval
set

Termination check interval property.

long Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.Timeout
set

Timeout property.

string Summer.Batch.Core.Step.Tasklet.SystemCommandTasklet.WorkingDirectory
set

Working directory property.


The documentation for this class was generated from the following file:
  • Summer.Batch.Core/Core/Step/Tasklet/SystemCommandTasklet.cs