Central convenience class for framework use in managing the scope context. More...
Public Member Functions | |
TContext | GetContext () |
Getter for the current context if there is one, otherwise returns null. More... | |
TContext | Register (TExecution execution) |
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... | |
void | Close () |
Method for unregistering the current context - should always and only be used by in conjunction with a matching Register(TExecution) to ensure that GetContext always returns the correct value. Does not call close on the context - 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 execution actually ended. More... | |
void | Increment () |
Increment execution counter. More... | |
void | Release () |
A convenient "deep" close operation. Call this instead of Close() if the execution for the current context is ending. Delegates to Close(TContext) and then ensures that Close() is also called in a finally block. More... | |
void | Dispose () |
IDisposable::Dispose More... | |
Protected Member Functions | |
abstract void | Close (TContext context) |
To be overriden by subclasses. More... | |
abstract TContext | CreateNewContext (TExecution execution) |
To be overriden by subclasses. More... | |
virtual void | Dispose (bool disposing) |
Effective dispose More... | |
Detailed Description
Central convenience class for framework use in managing the scope context.
- Template Parameters
-
TExecution the type of the execution TContext the type of the stored context
- Type Constraints
-
TContext : class TExecution : class
Member Function Documentation
void Summer.Batch.Core.Scope.Context.SynchronizationManagerSupport< TExecution, TContext >.Close | ( | ) |
Method for unregistering the current context - should always and only be used by in conjunction with a matching Register(TExecution) to ensure that GetContext always returns the correct value. Does not call close on the context - 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 execution actually ended.
|
protectedpure virtual |
To be overriden by subclasses.
- Parameters
-
context
|
protectedpure virtual |
To be overriden by subclasses.
- Parameters
-
execution
- Returns
void Summer.Batch.Core.Scope.Context.SynchronizationManagerSupport< TExecution, TContext >.Dispose | ( | ) |
IDisposable::Dispose
|
protectedvirtual |
Effective dispose
- Parameters
-
disposing
TContext Summer.Batch.Core.Scope.Context.SynchronizationManagerSupport< TExecution, TContext >.GetContext | ( | ) |
Getter for the current context if there is one, otherwise returns null.
- Returns
- the current context or null if there is none (if one has not been registered for this thread)
void Summer.Batch.Core.Scope.Context.SynchronizationManagerSupport< TExecution, TContext >.Increment | ( | ) |
Increment execution counter.
TContext Summer.Batch.Core.Scope.Context.SynchronizationManagerSupport< TExecution, TContext >.Register | ( | TExecution | execution | ) |
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
-
execution
- Returns
void Summer.Batch.Core.Scope.Context.SynchronizationManagerSupport< TExecution, TContext >.Release | ( | ) |
A convenient "deep" close operation. Call this instead of Close() if the execution for the current context is ending. Delegates to Close(TContext) 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/SynchronizationManagerSupport.cs