Class AsyncRetryExecutor.Task

java.lang.Object
com.imyeyu.java.thread.AsyncRetryExecutor.Task
Enclosing class:
AsyncRetryExecutor

public static class AsyncRetryExecutor.Task extends Object
任务
Since:
2025-11-06 23:37
Author:
夜雨
  • Constructor Details

    • Task

      public Task()
    • Task

      public Task(Callback callback, int maxRetry, long retryInterval, String threadNamePrefix, boolean daemon, CallbackArg<Exception> onRetryExhausted)
      Creates a new Task instance.
      Parameters:
      callback - 必填回调方法
      maxRetry - 最大重试次数,-1 为无限重试
      retryInterval - 重试间隔毫秒数
      threadNamePrefix - 线程名前缀
      daemon - 是否设置为守护线程
      onRetryExhausted - 重试耗尽时的异常回调
  • Method Details

    • builder

      public static AsyncRetryExecutor.Task.TaskBuilder builder()
    • getCallback

      public Callback getCallback()
      必填回调方法
    • getMaxRetry

      public int getMaxRetry()
      最大重试次数,-1 为无限重试
    • getRetryInterval

      public long getRetryInterval()
      重试间隔毫秒数
    • getThreadNamePrefix

      public String getThreadNamePrefix()
      线程名前缀
    • isDaemon

      public boolean isDaemon()
      是否设置为守护线程
    • getOnRetryExhausted

      public CallbackArg<Exception> getOnRetryExhausted()
      重试耗尽时的异常回调
    • setCallback

      public void setCallback(Callback callback)
      必填回调方法
    • setMaxRetry

      public void setMaxRetry(int maxRetry)
      最大重试次数,-1 为无限重试
    • setRetryInterval

      public void setRetryInterval(long retryInterval)
      重试间隔毫秒数
    • setThreadNamePrefix

      public void setThreadNamePrefix(String threadNamePrefix)
      线程名前缀
    • setDaemon

      public void setDaemon(boolean daemon)
      是否设置为守护线程
    • setOnRetryExhausted

      public void setOnRetryExhausted(CallbackArg<Exception> onRetryExhausted)
      重试耗尽时的异常回调
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object