|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
I - the type of item that will be processedpublic interface ItemProcessor<I>
Implements the logic that is required to process a certain type of item.
Instances of this class will be used byProcessingBucket when items are processed one by one. Note that
ItemProcessor instances will not be shared across a DSO cluster and are intended to be local on a node. They
are tied to an individual processing bucket and the thread that belongs to it. You're thus free to use local
resources in an ItemProcessor, like database connections or file handles.
ProcessingBucket| Method Summary | |
|---|---|
void |
process(Collection<I> items)
This method is called from within ProcessingBucket when enqueued items are processed int batch. |
void |
process(I item)
This method is called from within ProcessingBucket when enqueued items are processed one by one. |
| Method Detail |
|---|
void process(I item)
throws ProcessingException
ProcessingBucket when enqueued items are processed one by one.
When this
process method finishes, the corresponding item will be definitively removed from the bucket. Note that while the
item removal is transactional and your implementation of the process method can be done in a transactional
fashion, they are not transactional together. It is thus possible that your ItemProcessor succeeds and that
the node goes down before the item is actually removed from the bucket. Your ItemProcessor thus might have
to be implemented with some form of bookkeeping that is able to detect that a certain item has already been
processed. This can for example be a check on a unique item identifier that is allocated before starting the actual
processing of a new item.
item - the item that has to be processed
ProcessingException - when an error occurred during processing, the item will not be removed from the bucket
and all processing will be interrupted during the current run
void process(Collection<I> items)
throws ProcessingException
ProcessingBucket when enqueued items are processed int batch.
All documentation from the process(Object) method also applies here.
items - the items that have to be processed
ProcessingException - when an error occurred during processing, the item will not be removed from the bucket
and all processing will be interrupted during the current run
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||