Class AbstractJavaScheduler
java.lang.Object
me.lucko.luckperms.common.plugin.scheduler.AbstractJavaScheduler
- All Implemented Interfaces:
SchedulerAdapter
Abstract implementation of
SchedulerAdapter using a ScheduledExecutorService.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasync()Gets an async executor instanceasyncLater(Runnable task, long delay, TimeUnit unit) Executes the given task with a delay.asyncRepeating(Runnable task, long interval, TimeUnit unit) Executes the given task repeatedly at a given interval.voidShuts down the executor instance.voidShuts down the scheduler instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.lucko.luckperms.common.plugin.scheduler.SchedulerAdapter
executeAsync, executeSync, sync
-
Constructor Details
-
AbstractJavaScheduler
-
-
Method Details
-
async
Description copied from interface:SchedulerAdapterGets an async executor instance- Specified by:
asyncin interfaceSchedulerAdapter- Returns:
- an async executor instance
-
asyncLater
Description copied from interface:SchedulerAdapterExecutes the given task with a delay.- Specified by:
asyncLaterin interfaceSchedulerAdapter- Parameters:
task- the taskdelay- the delayunit- the unit of delay- Returns:
- the resultant task instance
-
asyncRepeating
Description copied from interface:SchedulerAdapterExecutes the given task repeatedly at a given interval.- Specified by:
asyncRepeatingin interfaceSchedulerAdapter- Parameters:
task- the taskinterval- the intervalunit- the unit of interval- Returns:
- the resultant task instance
-
shutdownScheduler
public void shutdownScheduler()Description copied from interface:SchedulerAdapterShuts down the scheduler instance.SchedulerAdapter.asyncLater(Runnable, long, TimeUnit)andSchedulerAdapter.asyncRepeating(Runnable, long, TimeUnit).- Specified by:
shutdownSchedulerin interfaceSchedulerAdapter
-
shutdownExecutor
public void shutdownExecutor()Description copied from interface:SchedulerAdapterShuts down the executor instance.SchedulerAdapter.async()andSchedulerAdapter.executeAsync(Runnable).- Specified by:
shutdownExecutorin interfaceSchedulerAdapter
-