Class ScheduledTask<T>
- java.lang.Object
-
- net.shibboleth.oidc.metadata.cache.impl.ScheduledTask<T>
-
- Type Parameters:
T- type of the result
- All Implemented Interfaces:
Comparable<Delayed>,Delayed,Future<T>,ScheduledFuture<T>
public class ScheduledTask<T> extends Object implements ScheduledFuture<T>
This code is copied verbatim from org.apache.flink.core.testutils.ScheduledTask ScheduledTask represents a task which is executed at a later point in time.
-
-
Constructor Summary
Constructors Constructor Description ScheduledTask(Callable<T> callable, long delay)ScheduledTask(Callable<T> callable, long delay, long period)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)intcompareTo(Delayed o)voidexecute()Tget()Tget(long timeout, TimeUnit unit)Callable<T>getCallable()longgetDelay(TimeUnit unit)booleanisCancelled()booleanisDone()booleanisPeriodic()
-
-
-
Field Detail
-
delay
private final long delay
-
period
private final long period
-
result
private final CompletableFuture<T> result
-
-
Method Detail
-
isPeriodic
public boolean isPeriodic()
-
execute
public void execute()
-
compareTo
public int compareTo(Delayed o)
- Specified by:
compareToin interfaceComparable<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<T>
-
get
public T get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, @Nonnull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-