org.compass.core.executor.workmanager
Class WorkCallableFutureAdapter<T>
java.lang.Object
org.compass.core.executor.workmanager.WorkCallableFutureAdapter<T>
- All Implemented Interfaces:
- Comparable<Delayed>, Runnable, Delayed, Future<T>, ScheduledFuture<T>, javax.resource.spi.work.Work
public class WorkCallableFutureAdapter<T>
- extends Object
- implements javax.resource.spi.work.Work, ScheduledFuture<T>
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WorkCallableFutureAdapter
public WorkCallableFutureAdapter(Callable<T> callable)
WorkCallableFutureAdapter
public WorkCallableFutureAdapter(Runnable runnable)
run
public void run()
- Specified by:
run in interface Runnable
release
public void release()
- Specified by:
release in interface javax.resource.spi.work.Work
setException
void setException(Exception e)
setDelegateScheduledFuture
void setDelegateScheduledFuture(ScheduledFuture<T> delegateScheduledFuture)
get
public T get()
throws InterruptedException,
ExecutionException
- Specified by:
get in interface Future<T>
- Throws:
InterruptedException
ExecutionException
get
public T get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get in interface Future<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
isDone
public boolean isDone()
- Specified by:
isDone in interface Future<T>
getDelay
public long getDelay(TimeUnit unit)
- Specified by:
getDelay in interface Delayed
compareTo
public int compareTo(Delayed o)
- Specified by:
compareTo in interface Comparable<Delayed>
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel in interface Future<T>
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled in interface Future<T>
Copyright (c) 2004-2008 The Compass Project.