C# Class Summer.Batch.Core.Scope.Context.StepContext

A context object that can be used to interrogate the current StepExecution and some of its associated properties using expressions based on bean paths. Has public getters for the step execution and convenience methods for accessing commonly used properties like the ExecutionContext associated with the step or its enclosing job execution.
Inheritance: Summer.Batch.Infrastructure.Repeat.Context.SynchronizedAttributeAccessor
显示文件 Open project: SummerBatch/SummerBatch Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Clean up the context at the end of a step execution. Must be called once at the end of a step execution to honour the destruction callback contract from the Step Scope.

Equals ( object other ) : bool

Equals override.

GetHashCode ( ) : int

Overrides the default behaviour to provide a hash code based only on the step execution.

GetId ( ) : string

GetJobExecutionContext ( ) : object>.IReadOnlyDictionary

Returns the job execution context.

GetJobName ( ) : string

Convenient accessor for current job name identifier.

GetJobParameters ( ) : JobParameter>.IReadOnlyDictionary

Returns the job parameters.

GetStepExecutionContext ( ) : object>.IReadOnlyDictionary

Returns the step execution context.

GetStepName ( ) : string

Convenient accessor for current step name identifier. Usually this is the same as the bean name of the step that is executing (but might not be e.g. in a partition).

RegisterDestructionCallback ( string name, System.Threading.Tasks.Task callback ) : void

Allow clients to register callbacks for clean up on close.

RemoveAttribute ( string name ) : object

Override base class behaviour to ensure destruction callbacks are unregistered as well as the default behaviour.

StepContext ( StepExecution stepExecution ) : System

Create a new instance of StepContext for this StepExecution.

ToString ( ) : string

ToString override.

Private Methods

Method Description
UnregisterDestructionCallbacks ( string name ) : void

Unregisters destruction callback.

Method Details

Close() public method

Clean up the context at the end of a step execution. Must be called once at the end of a step execution to honour the destruction callback contract from the Step Scope.
public Close ( ) : void
return void

Equals() public method

Equals override.
public Equals ( object other ) : bool
other object
return bool

GetHashCode() public method

Overrides the default behaviour to provide a hash code based only on the step execution.
public GetHashCode ( ) : int
return int

GetId() public method

public GetId ( ) : string
return string

GetJobExecutionContext() public method

Returns the job execution context.
public GetJobExecutionContext ( ) : object>.IReadOnlyDictionary
return object>.IReadOnlyDictionary

GetJobName() public method

Convenient accessor for current job name identifier.
public GetJobName ( ) : string
return string

GetJobParameters() public method

Returns the job parameters.
public GetJobParameters ( ) : JobParameter>.IReadOnlyDictionary
return JobParameter>.IReadOnlyDictionary

GetStepExecutionContext() public method

Returns the step execution context.
public GetStepExecutionContext ( ) : object>.IReadOnlyDictionary
return object>.IReadOnlyDictionary

GetStepName() public method

Convenient accessor for current step name identifier. Usually this is the same as the bean name of the step that is executing (but might not be e.g. in a partition).
public GetStepName ( ) : string
return string

RegisterDestructionCallback() public method

Allow clients to register callbacks for clean up on close.
public RegisterDestructionCallback ( string name, System.Threading.Tasks.Task callback ) : void
name string the callback id (unique attribute key in this context)
callback System.Threading.Tasks.Task a callback to execute on close
return void

RemoveAttribute() public method

Override base class behaviour to ensure destruction callbacks are unregistered as well as the default behaviour.
public RemoveAttribute ( string name ) : object
name string
return object

StepContext() public method

Create a new instance of StepContext for this StepExecution.
public StepContext ( StepExecution stepExecution ) : System
stepExecution StepExecution
return System

ToString() public method

ToString override.
public ToString ( ) : string
return string