Package top.focess.qq.core.schedule
Class FocessTask
- java.lang.Object
-
- top.focess.qq.core.schedule.FocessTask
-
- All Implemented Interfaces:
Task
- Direct Known Subclasses:
FocessCallback
public class FocessTask extends Object implements Task
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutionExceptionexceptionprotected booleanisFinishedprotected booleanisRunning
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)Cancel this taskdefault voidcancel0()voidclear()voidendRun()StringgetName()Get the name of the taskjava.time.DurationgetPeriod()PlugingetPlugin()Get the plugin it belongs toSchedulergetScheduler()Get the scheduler it belongs tobooleanisCancelled()Indicate whether this task is cancelled or notbooleanisFinished()Indicate whether this task is finished or notbooleanisPeriod()Indicate whether this task is a period-task or notbooleanisRunning()Indicate whether this task is running or notbooleanisSingleThread()voidrun()voidsetException(ExecutionException e)voidsetNativeTask(ComparableTask nativeTask)voidstartRun()
-
-
-
Field Detail
-
isRunning
protected boolean isRunning
-
isFinished
protected boolean isFinished
-
exception
protected ExecutionException exception
-
-
Method Detail
-
setNativeTask
public void setNativeTask(ComparableTask nativeTask)
-
clear
public void clear()
-
startRun
public void startRun()
-
endRun
public void endRun()
-
setException
public void setException(ExecutionException e)
-
isSingleThread
public boolean isSingleThread()
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
Description copied from interface:TaskCancel this task
-
isRunning
public boolean isRunning()
Description copied from interface:TaskIndicate whether this task is running or not
-
getPlugin
public Plugin getPlugin()
Description copied from interface:TaskGet the plugin it belongs to
-
getScheduler
public Scheduler getScheduler()
Description copied from interface:TaskGet the scheduler it belongs to- Specified by:
getSchedulerin interfaceTask- Returns:
- the scheduler it belongs to
-
isPeriod
public boolean isPeriod()
Description copied from interface:TaskIndicate whether this task is a period-task or not
-
isFinished
public boolean isFinished()
Description copied from interface:TaskIndicate whether this task is finished or not- Specified by:
isFinishedin interfaceTask- Returns:
- true if this task is finished, false otherwise
-
isCancelled
public boolean isCancelled()
Description copied from interface:TaskIndicate whether this task is cancelled or not- Specified by:
isCancelledin interfaceTask- Returns:
- true if it is cancelled, false otherwise
-
run
public void run() throws ExecutionException- Throws:
ExecutionException
-
getPeriod
public java.time.Duration getPeriod()
-
cancel0
public default void cancel0()
-
-