Policy for terminating a batch after a fixed number of operations. Internal state is maintained and a counter incremented, so successful use of this policy requires that IsComplete() is only called once per batch item. Using the standard RepeatTemplate should ensure this contract is kept, but it needs to be carefully monitored. More...
Classes | |
class | SimpleTerminationContext |
SimpleTerminationContext More... | |
Public Member Functions | |
SimpleCompletionPolicy () | |
Default constructor More... | |
SimpleCompletionPolicy (int chunkSize) | |
Custom constructor More... | |
override IRepeatContext | Start (IRepeatContext context) |
Resets the counter. More... | |
override bool | IsComplete (IRepeatContext context, RepeatStatus result) |
Terminates if the chunk size has been reached, or the result is null. More... | |
override bool | IsComplete (IRepeatContext context) |
Terminates if the chunk size has been reached. More... | |
override string | ToString () |
ToString override. More... | |
Public Member Functions inherited from Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport | |
void | Update (IRepeatContext context) |
Increments the context so the counter is up to date. Do nothing else. More... | |
Static Public Attributes | |
static readonly int | DefaultChunkSize = 5 |
Default chunk size. More... | |
Properties | |
int | ChunkSize [get, set] |
Chunk size. More... | |
Detailed Description
Policy for terminating a batch after a fixed number of operations. Internal state is maintained and a counter incremented, so successful use of this policy requires that IsComplete() is only called once per batch item. Using the standard RepeatTemplate should ensure this contract is kept, but it needs to be carefully monitored.
Constructor & Destructor Documentation
Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.SimpleCompletionPolicy | ( | ) |
Default constructor
Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.SimpleCompletionPolicy | ( | int | chunkSize | ) |
Custom constructor
- Parameters
-
chunkSize
Member Function Documentation
|
virtual |
Terminates if the chunk size has been reached, or the result is null.
- Parameters
-
context result
- Returns
Reimplemented from Summer.Batch.Infrastructure.Repeat.Policy.DefaultResultCompletionPolicy.
|
virtual |
Terminates if the chunk size has been reached.
- Parameters
-
context
- Returns
Reimplemented from Summer.Batch.Infrastructure.Repeat.Policy.DefaultResultCompletionPolicy.
|
virtual |
Resets the counter.
- Parameters
-
context
- Returns
Reimplemented from Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport.
override string Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.ToString | ( | ) |
ToString override.
- Returns
Member Data Documentation
|
static |
Default chunk size.
Property Documentation
|
getset |
Chunk size.
The documentation for this class was generated from the following file:
- Summer.Batch.Infrastructure/Repeat/Policy/SimpleCompletionPolicy.cs