An ITasklet that runs a powershell script. The script 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. Script 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 Types | |
enum | TimeoutBehaviorOption { TimeoutBehaviorOption.SetExitStatusToFailed, TimeoutBehaviorOption.ThrowException } |
Enumeration of the possible Timeout Bahavior Options... More... | |
Public Member Functions | |
void | AfterPropertiesSet () |
void | Stop () |
IStoppableTasklet::Stop. More... | |
RepeatStatus | Execute (StepContribution contribution, ChunkContext chunkContext) |
Wraps command execution into system process call. More... | |
override void | BeforeStep (StepExecution stepExecution) |
Public Member Functions inherited from Summer.Batch.Core.Listener.StepExecutionListenerSupport | |
virtual ExitStatus | AfterStep (StepExecution stepExecution) |
Static Protected Attributes | |
static readonly Logger | Logger = LogManager.GetCurrentClassLogger() |
Logger. More... | |
Properties | |
IResource | ScriptResource [set] |
ScriptResource (i.e. Script File to be exeuted in PowerShell runspace) More... | |
IDictionary< string, object > | Parameters [set] |
Parameters for powershell script file being executed...i.e. passed on the command line, accessed via Param() More... | |
IDictionary< string, object > | Variables [set] |
Variables for powershell script file being executed...available in PowerShell Runspace to the script More... | |
IPowerShellExitCodeMapper | PowerShellExitCodeMapper [set] |
System process exit code mapper property. More... | |
long | Timeout [set] |
Timeout property. More... | |
TimeoutBehaviorOption | TimeoutBehavior [get, set] |
FileType flag property. More... | |
long | TerminationCheckInterval [set] |
Termination check interval property. More... | |
IJobExplorer | JobExplorer [set] |
Job explorer property. More... | |
Detailed Description
An ITasklet that runs a powershell script. The script 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. Script 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.
- Since
- 1.1.0
Member Enumeration Documentation
Enumeration of the possible Timeout Bahavior Options...
Enumerator | |
---|---|
SetExitStatusToFailed |
Will Set Step ExitStatus to ExitStatus.Failed if script execution times out... |
ThrowException |
Will thow exception if script execution times out... |
Member Function Documentation
void Summer.Batch.Core.Step.Tasklet.PowerShellTasklet.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.PowerShellTasklet.Execute | ( | StepContribution | contribution, |
ChunkContext | chunkContext | ||
) |
Wraps command execution into system process call.
- Returns
- Exceptions
-
Exception
Implements Summer.Batch.Core.Step.Tasklet.ITasklet.
void Summer.Batch.Core.Step.Tasklet.PowerShellTasklet.Stop | ( | ) |
Member Data Documentation
|
staticprotected |
Logger.
Property Documentation
|
set |
Job explorer property.
|
set |
Parameters for powershell script file being executed...i.e. passed on the command line, accessed via Param()
|
set |
System process exit code mapper property.
|
set |
ScriptResource (i.e. Script File to be exeuted in PowerShell runspace)
|
set |
Termination check interval property.
|
set |
Timeout property.
|
getset |
FileType flag property.
|
set |
Variables for powershell script file being executed...available in PowerShell Runspace to the script
The documentation for this class was generated from the following file:
- Summer.Batch.Core/Core/Step/Tasklet/PowerShellTasklet.cs