com.caucho.config.async
Class AsyncItem<X>
java.lang.Object
com.caucho.config.async.AsyncItem<X>
- All Implemented Interfaces:
- java.lang.Runnable, java.util.concurrent.Future<X>
public abstract class AsyncItem<X>
- extends java.lang.Object
- implements java.lang.Runnable, java.util.concurrent.Future<X>
Represents the @Asynchronous interception
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AsyncItem
public AsyncItem()
isThreadCancelled
public static boolean isThreadCancelled()
runTask
public abstract java.util.concurrent.Future<X> runTask()
throws java.lang.Exception
- Throws:
java.lang.Exception
run
public final void run()
- Specified by:
run
in interface java.lang.Runnable
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface java.util.concurrent.Future<X>
get
public X get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
- Specified by:
get
in interface java.util.concurrent.Future<X>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
get
public X get(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
- Specified by:
get
in interface java.util.concurrent.Future<X>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface java.util.concurrent.Future<X>
isDone
public boolean isDone()
- Specified by:
isDone
in interface java.util.concurrent.Future<X>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object