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

Central convenience class for framework use in managing the job scope context. Generally only to be used by implementations of Job. N.B. it is the responsibility of every Job implementation to ensure that a JobContext is available on every thread that might be involved in a job execution, including worker threads from a pool. More...

Static Public Member Functions

static JobContext GetContext ()
 Getter for the current context if there is one, otherwise returns null. More...
 
static JobContext Register (JobExecution jobExecution)
 Register a context with the current thread - always put a matching Close call in a finally block to ensure that the correct context is available in the enclosing block. More...
 
static void Close ()
 Method for unregistering the current context - should always and only be used by in conjunction with a matching Register to ensure that GetContext always returns the correct value. Does not call JobContext.Close - that is left up to the caller because he has a reference to the context (having registered it) and only he has knowledge of when the step actually ended. More...
 
static void Release ()
 Release (delegates to Manager::Release). More...
 

Detailed Description

Central convenience class for framework use in managing the job scope context. Generally only to be used by implementations of Job. N.B. it is the responsibility of every Job implementation to ensure that a JobContext is available on every thread that might be involved in a job execution, including worker threads from a pool.

Member Function Documentation

static void Summer.Batch.Core.Scope.Context.JobSynchronizationManager.Close ( )
static

Method for unregistering the current context - should always and only be used by in conjunction with a matching Register to ensure that GetContext always returns the correct value. Does not call JobContext.Close - that is left up to the caller because he has a reference to the context (having registered it) and only he has knowledge of when the step actually ended.

static JobContext Summer.Batch.Core.Scope.Context.JobSynchronizationManager.GetContext ( )
static

Getter for the current context if there is one, otherwise returns null.

Returns
the current JobContext or null if there is none (if one has not been registered for this thread).
static JobContext Summer.Batch.Core.Scope.Context.JobSynchronizationManager.Register ( JobExecution  jobExecution)
static

Register a context with the current thread - always put a matching Close call in a finally block to ensure that the correct context is available in the enclosing block.

Parameters
jobExecutionthe step context to register
Returns
a new JobContext or the current one if it has the same JobExecution
static void Summer.Batch.Core.Scope.Context.JobSynchronizationManager.Release ( )
static

Release (delegates to Manager::Release).


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