类 ScheduledUtil

java.lang.Object
com.weicoder.common.thread.ScheduledUtil
直接已知子类:
T.S

public sealed class ScheduledUtil extends Object permits T.S
并发线程定时任务工具类
作者:
WD
  • 构造器详细资料

    • ScheduledUtil

      public ScheduledUtil()
  • 方法详细资料

    • newDelay

      public static ScheduledFuture<?> newDelay(Runnable command, long initialDelay, long delay)
      执行定时任务 按执行线程时间间隔
      参数:
      command - 线程任务
      initialDelay - 初始化时间
      delay - 间隔时间
      name - 名称
      unit - 时间戳
      返回:
      ScheduledFuture
    • newRate

      public static ScheduledFuture<?> newRate(Runnable command, int initialDelay, int delay)
      执行定时任务 按执行线程时间间隔
      参数:
      command - 线程任务
      initialDelay - 初始化时间
      delay - 间隔时间
      unit - 时间戳
      返回:
      ScheduledFuture
    • newSingle

      public static ScheduledExecutorService newSingle()
      获得单守护定时线程
      返回:
      缓存线程池
    • newPool

      public static ScheduledExecutorService newPool(int pool, boolean daemon)
      获得新的定时线程池
      参数:
      pool - 线程池数量
      daemon - 是否守护线程
      返回:
      缓存线程池
    • pool

      public static ScheduledExecutorService pool()
      获得定时任务池 此方法返回守护线程的池
      返回:
      定时任务池
    • pool

      public static ScheduledExecutorService pool(String name)
      获得定时任务池 此方法返回守护线程的池
      参数:
      name - 名称
      返回:
      定时任务池
    • rate

      public static ScheduledFuture<?> rate(Runnable command, long period)
      执行定时任务 按初始时间间隔
      参数:
      command - 线程任务
      period - 间隔时间 毫秒
      返回:
      ScheduledFuture
    • rate

      public static ScheduledFuture<?> rate(Runnable command, int period)
      执行定时任务 按初始时间间隔
      参数:
      command - 线程任务
      period - 间隔时间 秒
      返回:
      ScheduledFuture
    • rate

      public static ScheduledFuture<?> rate(Runnable command, long initialDelay, long period, TimeUnit unit)
      执行定时任务 按初始时间间隔
      参数:
      command - 线程任务
      initialDelay - 初始化时间
      period - 间隔时间
      unit - 时间戳
      返回:
      ScheduledFuture
    • rate

      public static ScheduledFuture<?> rate(String name, Runnable command, long period)
      执行定时任务 按初始时间间隔
      参数:
      name - 名称
      command - 线程任务
      period - 间隔时间 毫秒
      返回:
      ScheduledFuture
    • rate

      public static ScheduledFuture<?> rate(String name, Runnable command, int period)
      执行定时任务 按初始时间间隔
      参数:
      name - 名称
      command - 线程任务
      period - 间隔时间 秒
      返回:
      ScheduledFuture
    • rate

      public static ScheduledFuture<?> rate(String name, Runnable command, long initialDelay, long period, TimeUnit unit)
      执行定时任务 按初始时间间隔
      参数:
      name - 名称
      command - 线程任务
      initialDelay - 初始化时间
      period - 间隔时间
      unit - 时间戳
      返回:
      ScheduledFuture
    • delay

      public static ScheduledFuture<?> delay(Runnable command, long delay)
      执行定时任务 按执行线程时间间隔
      参数:
      command - 线程任务
      delay - 间隔时间 毫秒
      返回:
      ScheduledFuture
    • delay

      public static ScheduledFuture<?> delay(Runnable command, int delay)
      执行定时任务 按执行线程间隔
      参数:
      command - 线程任务
      delay - 间隔时间 秒
      返回:
      ScheduledFuture
    • delay

      public static ScheduledFuture<?> delay(Runnable command, long initialDelay, long delay, TimeUnit unit)
      执行定时任务 按执行线程时间间隔
      参数:
      command - 线程任务
      initialDelay - 初始化时间
      delay - 间隔时间
      unit - 时间戳
      返回:
      ScheduledFuture
    • delay

      public static ScheduledFuture<?> delay(String name, Runnable command, long delay)
      执行定时任务 按执行线程时间间隔
      参数:
      name - 名称
      command - 线程任务
      delay - 间隔时间 毫秒
      返回:
      ScheduledFuture
    • delay

      public static ScheduledFuture<?> delay(String name, Runnable command, int delay)
      执行定时任务 按执行线程间隔
      参数:
      name - 名称
      command - 线程任务
      delay - 间隔时间 秒
      返回:
      ScheduledFuture
    • delay

      public static ScheduledFuture<?> delay(String name, Runnable command, long initialDelay, long delay, TimeUnit unit)
      执行定时任务 按执行线程时间间隔
      参数:
      name - 名称
      command - 线程任务
      initialDelay - 初始化时间
      delay - 间隔时间
      unit - 时间戳
      返回:
      ScheduledFuture