Class SchedulerSessionUnitOfWorkManager


  • public final class SchedulerSessionUnitOfWorkManager
    extends Object
    Unit of work manager for work performed in a SchedulerSession.
    • 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,
                                                  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. See SchedulerSessionUnitOfWork 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 rethrown
        T - if the underlying unit of work throws an exception.
        T extends Exception
      • setPersistAllowedHelper

        public static void setPersistAllowedHelper​(PersistAllowedHelper newHelper)