Package top.focess.qq.core.schedule
Class FocessCallback<V>
- java.lang.Object
-
- top.focess.qq.core.schedule.FocessTask
-
- top.focess.qq.core.schedule.FocessCallback<V>
-
public class FocessCallback<V> extends FocessTask implements Callback<V>
-
-
Field Summary
-
Fields inherited from class top.focess.qq.core.schedule.FocessTask
exception, isFinished, isRunning
-
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description Vcall()Call the target valuedefault voidcancel0()voidendRun()Vget(long timeout, TimeUnit unit)Wait for the time and call the target valuevoidrun()-
Methods inherited from class top.focess.qq.core.schedule.FocessTask
cancel, clear, getName, getPeriod, getPlugin, getScheduler, isCancelled, isFinished, isPeriod, isRunning, isSingleThread, setException, setNativeTask, startRun
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.Future
cancel, isCancelled
-
Methods inherited from interface top.focess.qq.api.schedule.Task
cancel, cancel, getName, getPlugin, getScheduler, isCancelled, isFinished, isPeriod, isRunning
-
-
-
-
Method Detail
-
call
public V call() throws TaskNotFinishedException, CancellationException, ExecutionException
Description copied from interface:CallbackCall the target value- Specified by:
callin interfaceCallback<V>- Returns:
- the target value
- Throws:
TaskNotFinishedException- if the task is not finishedCancellationException- if the task is cancelledExecutionException- if there is any exception in the execution processing
-
get
public V get(long timeout, @NotNull TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException
Description copied from interface:CallbackWait for the time and call the target value- Specified by:
getin interfaceCallback<V>- Specified by:
getin interfaceFuture<V>- Parameters:
timeout- the timeoutunit- the time unit- Returns:
- the target value
- Throws:
InterruptedException- if the current thread was interrupted while waitingTimeoutException- if the time is outExecutionException- if there is any exception in the execution processing
-
run
public void run() throws ExecutionException- Overrides:
runin classFocessTask- Throws:
ExecutionException
-
endRun
public void endRun()
- Overrides:
endRunin classFocessTask
-
cancel0
public default void cancel0()
-
-