Package com.redwood.scheduler.api.uow
Class SchedulerSessionUnitOfWorkManager
- java.lang.Object
-
- com.redwood.scheduler.api.uow.SchedulerSessionUnitOfWorkManager
-
public final class SchedulerSessionUnitOfWorkManager extends Object
Unit of work manager for work performed in a SchedulerSession.
-
-
Constructor Summary
Constructors Constructor Description SchedulerSessionUnitOfWorkManager(SchedulerSessionSource newSource)
Create a new unit of work manager using the specified source
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Exception>
voidperform(SchedulerSessionUnitOfWork<T> uow)
Execute a unit of work.<T extends Exception>
voidperform(SchedulerSessionUnitOfWork<T> uow, int maxRetries, int maxSpins)
Execute a unit of work.static void
setPersistAllowedHelper(PersistAllowedHelper newHelper)
-
-
-
Constructor Detail
-
SchedulerSessionUnitOfWorkManager
public SchedulerSessionUnitOfWorkManager(SchedulerSessionSource newSource)
Create a new unit of work manager using the specified source- Parameters:
newSource
- the source.
-
-
Method Detail
-
perform
public <T extends Exception> void perform(SchedulerSessionUnitOfWork<T> uow) throws SchedulerAPIPersistenceException, T extends Exception
Execute a unit of work.- Parameters:
uow
- The object to use to perform the work. Generic in the type of Exception its performWork method it throws. SeeSchedulerSessionUnitOfWork
for the problems with using a raw type here.- Throws:
SchedulerAPIPersistenceException
- if the persist fails maxretries times, then the last thrown exception will be rethrownT
- if the underlying unit of work throws an exception.T extends Exception
-
perform
public <T extends Exception> void perform(SchedulerSessionUnitOfWork<T> uow, int maxRetries, int maxSpins) throws SchedulerAPIPersistenceException, T extends Exception
Execute a unit of work. If this thread is interrupted while a unit of work is underway, the unit of work proceeds until either completion or the number of retries is exhausted, at which point the most-recent persist() exception is thrown.- Parameters:
uow
- The object to use to perform the work. Generic in the type of Exception its performWork method it throws. SeeSchedulerSessionUnitOfWork
for the problems with using a raw type here.maxRetries
- The total number of times to retry.maxSpins
- The number of times to retry without pausing in between.- Throws:
SchedulerAPIPersistenceException
- if the persist fails maxretries times, then the last thrown exception will be rethrownT
- if the underlying unit of work throws an exception.T extends Exception
-
setPersistAllowedHelper
public static void setPersistAllowedHelper(PersistAllowedHelper newHelper)
-
-