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

A context object that can be used to interrogate the current JobExecution and some of its associated properties using expressions based on bean paths. Has public getters for the job execution and convenience methods for accessing commonly used properties like the ExecutionContext associated with the job execution. More...

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

Public Member Functions

 JobContext (JobExecution jobExecution)
 Custom constructor using a JobExecution. More...
 
string GetJobName ()
 Convenient accessor for current job name identifier. More...
 
IReadOnlyDictionary< string, object > GetJobExecutionContext ()
 
IReadOnlyDictionary< string, JobParameterGetJobParameters ()
 
void RegisterDestructionCallback (string name, Task callback)
 Registers a destruction callback. 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 ()
 Cleans 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 StepScope. More...
 
string GetId ()
 
override bool Equals (object other)
 Equals override. More...
 
override int GetHashCode ()
 GetHashCode override. More...
 
override string ToString ()
 ToString override. 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

JobExecution JobExecution [get]
 Job execution property. More...
 

Detailed Description

A context object that can be used to interrogate the current JobExecution and some of its associated properties using expressions based on bean paths. Has public getters for the job execution and convenience methods for accessing commonly used properties like the ExecutionContext associated with the job execution.

Constructor & Destructor Documentation

Summer.Batch.Core.Scope.Context.JobContext.JobContext ( JobExecution  jobExecution)

Custom constructor using a JobExecution.

Parameters
jobExecution

Member Function Documentation

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

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

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

Equals override.

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

GetHashCode override.

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

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

Returns
a dictionary containing the items from the job ExecutionContext
string Summer.Batch.Core.Scope.Context.JobContext.GetJobName ( )

Convenient accessor for current job name identifier.

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

Returns
a dictionary containing the items from the job ExecutionContext
void Summer.Batch.Core.Scope.Context.JobContext.RegisterDestructionCallback ( string  name,
Task  callback 
)

Registers a destruction callback.

Parameters
name
callback
override object Summer.Batch.Core.Scope.Context.JobContext.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.JobContext.ToString ( )

ToString override.

Returns

Property Documentation

JobExecution Summer.Batch.Core.Scope.Context.JobContext.JobExecution
get

Job execution property.


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