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

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

Static Public Member Functions

static StepContext GetContext ()
 Getter for the current context if there is one, otherwise returns null. More...
 
static StepContext Register (StepExecution stepExecution)
 Registers 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(Summer.Batch.Core.StepExecution) to ensure that GetContext always returns the correct value. Does not call StepContext.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 ()
 A convenient "deep" close operation. Call this instead of Close if the step execution for the current context is ending. Delegates to StepContextClose and then ensures that Close is also called in a finally block. More...
 

Detailed Description

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

Member Function Documentation

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

Method for unregistering the current context - should always and only be used by in conjunction with a matching Register(Summer.Batch.Core.StepExecution) to ensure that GetContext always returns the correct value. Does not call StepContext.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 StepContext Summer.Batch.Core.Scope.Context.StepSynchronizationManager.GetContext ( )
static

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

Returns
the current StepContext or null if there is none (if one has not been registered for this thread).
static StepContext Summer.Batch.Core.Scope.Context.StepSynchronizationManager.Register ( StepExecution  stepExecution)
static

Registers 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
stepExecutionthe step context to register
Returns
a new StepContext or the current one if it has the same StepExecution
static void Summer.Batch.Core.Scope.Context.StepSynchronizationManager.Release ( )
static

A convenient "deep" close operation. Call this instead of Close if the step execution for the current context is ending. Delegates to StepContextClose and then ensures that Close is also called in a finally block.


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