public abstract class AsyncItem<X>
extends java.lang.Object
implements java.lang.Runnable, java.util.concurrent.Future<X>
Constructor and Description |
---|
AsyncItem() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
X |
get() |
X |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
static boolean |
isThreadCancelled() |
void |
run() |
abstract java.util.concurrent.Future<X> |
runTask() |
java.lang.String |
toString() |
public static boolean isThreadCancelled()
public abstract java.util.concurrent.Future<X> runTask() throws java.lang.Exception
java.lang.Exception
public final void run()
run
in interface java.lang.Runnable
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<X>
public X get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<X>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public X get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<X>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<X>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<X>
public java.lang.String toString()
toString
in class java.lang.Object