public static class TimeScheduler3.Task extends Object implements Runnable, Delayed, Future
Modifier and Type | Field and Description |
---|---|
protected boolean |
can_block |
protected boolean |
cancelled |
protected long |
creation_time |
protected long |
delay |
protected boolean |
done |
protected Runnable |
runnable |
Constructor and Description |
---|
Task(Runnable runnable,
boolean can_block) |
Task(Runnable runnable,
long initial_delay,
TimeUnit unit,
boolean can_block) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBlock() |
boolean |
cancel(boolean mayInterruptIfRunning) |
int |
compareTo(Delayed o) |
Object |
get() |
Object |
get(long timeout,
TimeUnit unit) |
long |
getDelay(TimeUnit unit) |
Runnable |
getRunnable() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
run() |
String |
toString() |
protected final Runnable runnable
protected long creation_time
protected long delay
protected volatile boolean cancelled
protected volatile boolean done
protected final boolean can_block
public Task(Runnable runnable, boolean can_block)
public Runnable getRunnable()
public boolean canBlock()
public int compareTo(Delayed o)
compareTo
in interface Comparable<Delayed>
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future
public Object get() throws InterruptedException, ExecutionException
get
in interface Future
InterruptedException
ExecutionException
public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future
InterruptedException
ExecutionException
TimeoutException
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.