Package com.redwood.scheduler.api.uow
Interface SchedulerSessionUnitOfWork<T extends Exception>
-
- Type Parameters:
T
- subclass of Exception that is thrown by the performWork method. Note: It is possible to do an unchecked conversion of a rawSchedulerSessionUnitOfWork
type toSchedulerSessionUnitOfWork
<RuntimeException>. The object of the raw type might throw a checked exception, however when converted toSchedulerSessionUnitOfWork
<RuntimeException> this exception is no longer checked. This should be avoided since this will lead to problems with the Exception handling becoming very hard to trace.
public interface SchedulerSessionUnitOfWork<T extends Exception>
Unit of work to be performed using a scheduler session.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
performWork(SchedulerSession session)
This method defines the unit of work to perform.
-
-
-
Method Detail
-
performWork
void performWork(SchedulerSession session) throws T extends Exception
This method defines the unit of work to perform. It will be called potentially multiple times, each time with a newSchedulerSession
. After the method has returnedSchedulerSession.persist()
will be called on session. Should this fail with a no rows updated exception then the method will called again after a random delay, with a a new SchedulerSession. Should it fail too many times, the last exception will be rethrown.
-
-