Summer.Batch.Core.Scope.Context.StepContext Class Reference

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

Inheritance diagram for Summer.Batch.Core.Scope.Context.StepContext:
Summer.Batch.Infrastructure.Repeat.Context.SynchronizedAttributeAccessor Summer.Batch.Common.Util.IAttributeAccessor

Public Member Functions

 StepContext (StepExecution stepExecution)
 Create a new instance of StepContext for this StepExecution. More...
 
string GetStepName ()
 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). More...
 
string GetJobName ()
 Convenient accessor for current job name identifier. More...
 
IReadOnlyDictionary< string, object > GetStepExecutionContext ()
 Returns the step execution context. More...
 
IReadOnlyDictionary< string, object > GetJobExecutionContext ()
 Returns the job execution context. More...
 
IReadOnlyDictionary< string, JobParameterGetJobParameters ()
 Returns the job parameters. More...
 
string GetId ()
 
override bool Equals (object other)
 Equals override. More...
 
override int GetHashCode ()
 Overrides the default behaviour to provide a hash code based only on the step execution. More...
 
override string ToString ()
 ToString override. More...
 
void RegisterDestructionCallback (string name, Task callback)
 Allow clients to register callbacks for clean up on close. More...
 
override object RemoveAttribute (string name)
 Override base class behaviour to ensure destruction callbacks are unregistered as well as the default behaviour. More...
 
void Close ()
 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. More...
 
- Public Member Functions inherited from Summer.Batch.Infrastructure.Repeat.Context.SynchronizedAttributeAccessor
void SetAttribute (string name, object val)
 
object GetAttribute (string name)
 
bool HasAttribute (string name)
 
string[] AttributeNames ()
 
override string ToString ()
 ToString override. More...
 
object SetAttributeIfAbsent (string name, object val)
 Additional support for atomic put if absent. More...
 
override int GetHashCode ()
 GetHashCode override. More...
 
override bool Equals (object other)
 Equals override. More...
 
void Dispose ()
 see https://msdn.microsoft.com/fr-fr/library/ms244737.aspx More...
 

Properties

StepExecution StepExecution [get]
 Step Execution property. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

Summer.Batch.Core.Scope.Context.StepContext.StepContext ( StepExecution  stepExecution)

Create a new instance of StepContext for this StepExecution.

Parameters
stepExecution

Member Function Documentation

void Summer.Batch.Core.Scope.Context.StepContext.Close ( )

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.

override bool Summer.Batch.Core.Scope.Context.StepContext.Equals ( object  other)

Equals override.

Parameters
other
Returns
override int Summer.Batch.Core.Scope.Context.StepContext.GetHashCode ( )

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

Returns
string Summer.Batch.Core.Scope.Context.StepContext.GetId ( )

Returns
an unique identifier for this context based on the step execution
IReadOnlyDictionary<string, object> Summer.Batch.Core.Scope.Context.StepContext.GetJobExecutionContext ( )

Returns the job execution context.

Returns
string Summer.Batch.Core.Scope.Context.StepContext.GetJobName ( )

Convenient accessor for current job name identifier.

Returns
IReadOnlyDictionary<string, JobParameter> Summer.Batch.Core.Scope.Context.StepContext.GetJobParameters ( )

Returns the job parameters.

Returns
IReadOnlyDictionary<string, object> Summer.Batch.Core.Scope.Context.StepContext.GetStepExecutionContext ( )

Returns the step execution context.

Returns
string Summer.Batch.Core.Scope.Context.StepContext.GetStepName ( )

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

Returns
void Summer.Batch.Core.Scope.Context.StepContext.RegisterDestructionCallback ( string  name,
Task  callback 
)

Allow clients to register callbacks for clean up on close.

Parameters
namethe callback id (unique attribute key in this context)
callbacka callback to execute on close
override object Summer.Batch.Core.Scope.Context.StepContext.RemoveAttribute ( string  name)
virtual

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

Parameters
name
Returns

Reimplemented from Summer.Batch.Infrastructure.Repeat.Context.SynchronizedAttributeAccessor.

override string Summer.Batch.Core.Scope.Context.StepContext.ToString ( )

ToString override.

Returns

Property Documentation

StepExecution Summer.Batch.Core.Scope.Context.StepContext.StepExecution
get

Step Execution property.


The documentation for this class was generated from the following file:
  • Summer.Batch.Core/Core/Scope/Context/StepContext.cs