ariba.util.core
Class BatchProcessor

java.lang.Object
  extended by ariba.util.core.BatchProcessor

public abstract class BatchProcessor
extends java.lang.Object

Convenience class that abstracts the notion of processing a collection of objects in chunks of a given size.


Constructor Summary
BatchProcessor()
           
 
Method Summary
 void process(java.util.Collection collection, BatchSizer sizer)
          Processes the supplied collection which may be of any size.
 void process(java.util.Collection collection, int batchSize)
          Processes the supplied collection which may be of any size.
 void process(java.util.List list, int batchSize)
          Processes the supplied list which may be of any size.
abstract  void processBatch(java.util.Collection collection)
          Processes the supplied collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchProcessor

public BatchProcessor()
Method Detail

processBatch

public abstract void processBatch(java.util.Collection collection)
                           throws BatchProcessingException
Processes the supplied collection.

Throws:
BatchProcessingException - if there is an exception procesing collection

process

public final void process(java.util.Collection collection,
                          BatchSizer sizer)
                   throws BatchProcessingException
Processes the supplied collection which may be of any size. This implementation splits collection up into batches and repeatedly calls processBatch(java.util.Collection) as necessary.

If collection is a List, then this method calls processBatch(java.util.Collection) with Lists. Similarly for SortedSets.

Each of the calls to process() satisfies the following conditions:

Throws:
BatchProcessingException - if there is an exception procesing the batches

process

public final void process(java.util.Collection collection,
                          int batchSize)
                   throws BatchProcessingException
Processes the supplied collection which may be of any size. This implementation splits collection up into batches and repeatedly calls processBatch(java.util.Collection) as necessary.

If collection is a List, then this method calls processBatch(java.util.Collection) with Lists. Similarly for SortedSets.

Each of the calls to process() satisfies the following conditions:

Throws:
BatchProcessingException - if there is an exception procesing the batches

process

public final void process(java.util.List list,
                          int batchSize)
                   throws BatchProcessingException
Processes the supplied list which may be of any size. This implementation splits list up into batches and repeatedly calls processBatch(java.util.Collection) as necessary. Each of the calls to process() satisfies the following conditions:

Throws:
BatchProcessingException - if there is an exception procesing the batches


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.