Package com.redwood.scheduler.api.uow
Class SchedulerSessionBatchedUnitOfWorkManager
- java.lang.Object
- 
- com.redwood.scheduler.api.uow.SchedulerSessionBatchedUnitOfWorkManager
 
- 
 public class SchedulerSessionBatchedUnitOfWorkManager extends Object Extending the unit-of-work pattern, this class allows large amounts of work to be processed in batches.- See Also:
- SchedulerSessionUnitOfWork
 
- 
- 
Constructor SummaryConstructors Constructor Description SchedulerSessionBatchedUnitOfWorkManager(SchedulerSessionUnitOfWorkManager newUowManager, int newBatchSize)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetBatchSize()protected SchedulerSessionUnitOfWorkManagergetUnitOfWorkManager()<T> voidperform(SchedulerSessionBatchedUnitOfWork<T> buow)Execute batched units of work.protected <T> voidprocessBatch(SchedulerSessionBatchedUnitOfWork<T> buow, SchedulerSession session, Iterator<T> batch)
 
- 
- 
- 
Constructor Detail- 
SchedulerSessionBatchedUnitOfWorkManagerpublic SchedulerSessionBatchedUnitOfWorkManager(SchedulerSessionUnitOfWorkManager newUowManager, int newBatchSize) - Parameters:
- newUowManager-
- newBatchSize-
 
 
- 
 - 
Method Detail- 
performpublic <T> void perform(SchedulerSessionBatchedUnitOfWork<T> buow) throws Exception Execute batched units of work.- Parameters:
- buow- The class to use to perform the batched work.
- Throws:
- com.redwood.scheduler.api.exception.SchedulerAPIPersistenceException- If the batch of work fails to be processed enough times in a row the last thrown exception will be propagated. (The number of times is the maximum number of times the configured- SchedulerSessionUnitOfWorkManagerwill retry a unit of work.)
- Exception- If an error occurs
 
 - 
getUnitOfWorkManagerprotected SchedulerSessionUnitOfWorkManager getUnitOfWorkManager() 
 - 
getBatchSizeprotected int getBatchSize() 
 - 
processBatchprotected <T> void processBatch(SchedulerSessionBatchedUnitOfWork<T> buow, SchedulerSession session, Iterator<T> batch) throws InterruptedException - Throws:
- InterruptedException
 
 
- 
 
-