Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy Class Reference

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

Inheritance diagram for Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy:
Summer.Batch.Infrastructure.Repeat.Policy.DefaultResultCompletionPolicy Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport Summer.Batch.Infrastructure.Repeat.ICompletionPolicy

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

override bool Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.IsComplete ( IRepeatContext  context,
RepeatStatus  result 
)
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.

override bool Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.IsComplete ( IRepeatContext  context)
virtual

Terminates if the chunk size has been reached.

Parameters
context
Returns

Reimplemented from Summer.Batch.Infrastructure.Repeat.Policy.DefaultResultCompletionPolicy.

override IRepeatContext Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.Start ( IRepeatContext  context)
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

readonly int Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.DefaultChunkSize = 5
static

Default chunk size.

Property Documentation

int Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy.ChunkSize
getset

Chunk size.


The documentation for this class was generated from the following file:
  • Summer.Batch.Infrastructure/Repeat/Policy/SimpleCompletionPolicy.cs