Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut > Class Template Reference

Simple implementation of the T:IChunkProcessorinterface that handles basic item writing and processing. Any exceptions encountered will be rethrown. More...

Inheritance diagram for Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >:
Summer.Batch.Core.Step.Item.IChunkProcessor< TIn > Summer.Batch.Common.Factory.IInitializationPostOperations

Public Member Functions

void AfterPropertiesSet ()
 
 SimpleChunkProcessor (IItemProcessor< TIn, TOut > itemProcessor, IItemWriter< TOut > itemWriter)
 Custom constructor using and itemprocessor and an itemwriter. More...
 
void Process (StepContribution contribution, Chunk< TIn > inputs)
 see IChunkProcessor::Process. More...
 
- Public Member Functions inherited from Summer.Batch.Core.Step.Item.IChunkProcessor< TIn >
void Process (StepContribution contribution, Chunk< TI > chunk)
 Process the chunk. More...
 

Protected Member Functions

void InitializeUserData (Chunk< TIn > inputs)
 Extension point for subclasses to allow them to memorise the contents of the inputs, in case they are needed for accounting purposes later. The default implementation sets up some user data to remember the original size of the inputs. If this method is overridden then some or all of IsComplete, GetFilterCount and GetAdjustedOutputs might also need to be, to ensure that the user data is handled consistently. More...
 
bool IsComplete (Chunk< TIn > inputs)
 Extension point for subclasses that want to store additional data in the inputs. Default just checks if inputs are empty. More...
 
TOut DoProcess (TIn item)
 Process item. More...
 
Chunk< TOut > Transform (StepContribution contribution, Chunk< TIn > inputs)
 Transform inputs. More...
 
int GetFilterCount (Chunk< TIn > inputs, Chunk< TOut > outputs)
 Extension point for subclasses to calculate the filter count. Defaults to the difference between input size and output size. More...
 
Chunk< TOut > GetAdjustedOutputs (Chunk< TIn > inputs, Chunk< TOut > outputs)
 Extension point for subclasses that want to adjust the outputs based on additional saved data in the inputs. Default implementation just returns the outputs unchanged. More...
 
void Write (StepContribution contribution, Chunk< TIn > inputs, Chunk< TOut > outputs)
 Simple implementation delegates to the DoWrite method and increments the write count in the contribution. Subclasses can handle more complicated scenarios, e.g.with fault tolerance. If output items are skipped they should be removed from the inputs as well. More...
 
void DoWrite (IList< TOut > items)
 Actual write operation. Delegates to WriteItems. More...
 
void WriteItems (IList< TOut > items)
 Write list of items More...
 

Properties

IItemProcessor< TIn, TOut > ItemProcessor [get, set]
 Item processor property. More...
 
IItemWriter< TOut > ItemWriter [get, set]
 Item writer property. More...
 

Detailed Description

Simple implementation of the T:IChunkProcessorinterface that handles basic item writing and processing. Any exceptions encountered will be rethrown.

Template Parameters
TIn 
TOut 
Type Constraints
TIn :class 
TOut :class 

Constructor & Destructor Documentation

Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.SimpleChunkProcessor ( IItemProcessor< TIn, TOut >  itemProcessor,
IItemWriter< TOut >  itemWriter 
)

Custom constructor using and itemprocessor and an itemwriter.

Parameters
itemProcessor
itemWriter

Member Function Documentation

void Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.AfterPropertiesSet ( )

See also
IInitializationPostOperations::AfterPropertiesSet.

Implements Summer.Batch.Common.Factory.IInitializationPostOperations.

TOut Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.DoProcess ( TIn  item)
protected

Process item.

Parameters
item
Returns
Exceptions
System.Exception
void Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.DoWrite ( IList< TOut >  items)
protected

Actual write operation. Delegates to WriteItems.

Parameters
items
Exceptions
Exception 
Chunk<TOut> Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.GetAdjustedOutputs ( Chunk< TIn >  inputs,
Chunk< TOut >  outputs 
)
protected

Extension point for subclasses that want to adjust the outputs based on additional saved data in the inputs. Default implementation just returns the outputs unchanged.

Parameters
inputs
outputs
Returns
int Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.GetFilterCount ( Chunk< TIn >  inputs,
Chunk< TOut >  outputs 
)
protected

Extension point for subclasses to calculate the filter count. Defaults to the difference between input size and output size.

Parameters
inputs
outputs
Returns
void Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.InitializeUserData ( Chunk< TIn >  inputs)
protected

Extension point for subclasses to allow them to memorise the contents of the inputs, in case they are needed for accounting purposes later. The default implementation sets up some user data to remember the original size of the inputs. If this method is overridden then some or all of IsComplete, GetFilterCount and GetAdjustedOutputs might also need to be, to ensure that the user data is handled consistently.

Parameters
inputsthe inputs for the process
bool Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.IsComplete ( Chunk< TIn >  inputs)
protected

Extension point for subclasses that want to store additional data in the inputs. Default just checks if inputs are empty.

Parameters
inputs
Returns
void Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.Process ( StepContribution  contribution,
Chunk< TIn >  inputs 
)

see IChunkProcessor::Process.

Parameters
contribution
inputs
Chunk<TOut> Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.Transform ( StepContribution  contribution,
Chunk< TIn >  inputs 
)
protected

Transform inputs.

Parameters
contribution
inputs
Returns
Exceptions
System.Exception
void Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.Write ( StepContribution  contribution,
Chunk< TIn >  inputs,
Chunk< TOut >  outputs 
)
protected

Simple implementation delegates to the DoWrite method and increments the write count in the contribution. Subclasses can handle more complicated scenarios, e.g.with fault tolerance. If output items are skipped they should be removed from the inputs as well.

Parameters
contribution
inputs
outputs
Exceptions
Exception 
void Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.WriteItems ( IList< TOut >  items)
protected

Write list of items

Parameters
items

Property Documentation

IItemProcessor<TIn, TOut> Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.ItemProcessor
getset

Item processor property.

IItemWriter<TOut> Summer.Batch.Core.Step.Item.SimpleChunkProcessor< TIn, TOut >.ItemWriter
getset

Item writer property.


The documentation for this class was generated from the following file:
  • Summer.Batch.Core/Core/Step/Item/SimpleChunkProcessor.cs