Package cool.scx.common.scheduler
Class ScxScheduler
java.lang.Object
cool.scx.common.scheduler.ScxScheduler
- All Implemented Interfaces:
AutoCloseable,Executor,ExecutorService,ScheduledExecutorService,org.springframework.scheduling.TaskScheduler
public final class ScxScheduler
extends Object
implements ScheduledExecutorService, org.springframework.scheduling.TaskScheduler
- Version:
- 2.4.8
- Author:
- scx567888
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long timeout, TimeUnit unit) voidinvokeAll(Collection<? extends Callable<T>> tasks) invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> TinvokeAny(Collection<? extends Callable<T>> tasks) <T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) booleanboolean<R> ScheduledFuture<R> schedule(Consumer<ScheduleStatus> scxHandler, org.springframework.scheduling.Trigger trigger) schedule(Consumer<ScheduleStatus> scxHandler, org.springframework.scheduling.Trigger trigger, long maxRunCount) scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleAtFixedRate(Runnable task, Duration period) scheduleAtFixedRate(Runnable task, Instant startTime, Duration period) scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, long initialDelay, long period, TimeUnit unit) scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, long initialDelay, long period, TimeUnit unit, long maxRunCount) scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Duration delay) scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Duration delay, long maxRunCount) scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay) scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay, long maxRunCount) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) scheduleWithFixedDelay(Runnable task, Duration delay) scheduleWithFixedDelay(Runnable task, Instant startTime, Duration delay) scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, long initialDelay, long delay, TimeUnit unit) scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, long initialDelay, long delay, TimeUnit unit, long maxRunCount) scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Duration delay) scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Duration delay, long maxRunCount) scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay) scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay, long maxRunCount) voidshutdown()Future<?> <T> Future<T> <R> Future<R> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
closeMethods inherited from interface org.springframework.scheduling.TaskScheduler
getClock, schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
-
Constructor Details
-
ScxScheduler
-
-
Method Details
-
schedule
- Specified by:
schedulein interfaceorg.springframework.scheduling.TaskScheduler
-
schedule
- Specified by:
schedulein interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRatein interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRatein interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelayin interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelayin interfaceorg.springframework.scheduling.TaskScheduler
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
- Specified by:
shutdownNowin interfaceExecutorService
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceExecutorService
-
awaitTermination
- Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
execute
-
schedule
public ScheduledFuture<?> schedule(Consumer<ScheduleStatus> scxHandler, org.springframework.scheduling.Trigger trigger) -
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay) -
scheduleAtFixedRate
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay) -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Duration delay) -
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, long initialDelay, long period, TimeUnit unit) -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, long initialDelay, long delay, TimeUnit unit) -
schedule
public ScheduledFuture<?> schedule(Consumer<ScheduleStatus> scxHandler, org.springframework.scheduling.Trigger trigger, long maxRunCount) -
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay, long maxRunCount) -
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, Duration delay, long maxRunCount) -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Instant startTime, Duration delay, long maxRunCount) -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, Duration delay, long maxRunCount) -
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Consumer<ScheduleStatus> scxHandler, long initialDelay, long period, TimeUnit unit, long maxRunCount) -
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Consumer<ScheduleStatus> scxHandler, long initialDelay, long delay, TimeUnit unit, long maxRunCount)
-