Class ExecutionAttempts


  • public class ExecutionAttempts
    extends Object
    This class embeds a logic of reattempting the execution of jobs when an exception is thrown during a job execution. It provides a simple retry mechanism.
    • Constructor Detail

      • ExecutionAttempts

        public ExecutionAttempts()
    • Method Detail

      • retry

        public static void retry​(int maxAttempts,
                                 ExecutionAttempts.Job aJob)
                          throws Exception
        Wraps a job with a retry mechanism.
        Parameters:
        maxAttempts - the maximum number of execution attempts that are authorized before throwing really the exception.
        aJob - the job to run within a retry mechanism.
        Throws:
        Exception - the exception the job has thrown when the maximum execution attempts has been reached.