Class QuartzRetry<P extends Serializable,​R>

  • Type Parameters:
    P - Type of the payload (e.g. could be a DTO for sending to a remote service)
    R - Type of the result (e.g. the response type of the remote service)

    public abstract class QuartzRetry<P extends Serializable,​R>
    extends Object
    Extend this class for adding quartz retry to your application
    • Constructor Detail

      • QuartzRetry

        public QuartzRetry()
    • Method Detail

      • process

        protected abstract R process​(P payload,
                                     RetryContext ctx)
      • getRetryTimeouts

        protected abstract RetryTimeout[] getRetryTimeouts()
      • onSuccess

        protected abstract void onSuccess​(P payload,
                                          R result,
                                          RetryContext ctx)
      • setScheduler

        @Autowired
        public final void setScheduler​(org.quartz.Scheduler scheduler)
        Sets the current quartz scheduler automatically by injection There should not be a need to call this method manually.
        Parameters:
        scheduler - The current quartz scheduler instance
      • execute

        public void execute​(P payload)
        Starts the retry attempt
        Parameters:
        payload - The payload object to process
      • execute

        public void execute​(P payload,
                            RetryContext ctx)
        Starts the retry atttempt
        Parameters:
        payload - The payload object to process
        ctx - The current RetryContext