Package pl.morgwai.base.utils.concurrent
Class ScheduledTaskTrackingThreadPoolExecutor.ScheduledExecution<V>
- java.lang.Object
-
- pl.morgwai.base.utils.concurrent.ScheduledTaskTrackingThreadPoolExecutor.ScheduledExecution<V>
-
- All Implemented Interfaces:
Comparable<Delayed>,Runnable,Delayed,Future<V>,RunnableFuture<V>,RunnableScheduledFuture<V>,ScheduledFuture<V>
- Enclosing class:
- ScheduledTaskTrackingThreadPoolExecutor
public static class ScheduledTaskTrackingThreadPoolExecutor.ScheduledExecution<V> extends Object implements RunnableScheduledFuture<V>
Decorates aRunnableScheduledFutureto allow to obtain the original scheduled task.
-
-
Constructor Summary
Constructors Constructor Description ScheduledExecution(Object task, RunnableScheduledFuture<V> scheduledItemToWrap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)intcompareTo(Delayed o)Vget()Vget(long timeout, TimeUnit unit)longgetDelay(TimeUnit unit)ObjectgetTask()The original scheduled task.booleanisCancelled()booleanisDone()booleanisPeriodic()voidrun()
-
-
-
Constructor Detail
-
ScheduledExecution
public ScheduledExecution(Object task, RunnableScheduledFuture<V> scheduledItemToWrap)
-
-
Method Detail
-
getTask
public Object getTask()
-
isPeriodic
public boolean isPeriodic()
- Specified by:
isPeriodicin interfaceRunnableScheduledFuture<V>
-
run
public void run()
- Specified by:
runin interfaceRunnable- Specified by:
runin interfaceRunnableFuture<V>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<V>
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
compareTo
public int compareTo(Delayed o)
- Specified by:
compareToin interfaceComparable<V>
-
-