org.compass.core.executor.workmanager
Class WorkCallableFutureAdapter<T>

java.lang.Object
  extended by 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

Constructor Summary
WorkCallableFutureAdapter(Callable<T> callable)
           
WorkCallableFutureAdapter(Runnable runnable)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 int compareTo(Delayed o)
           
 T get()
           
 T get(long timeout, TimeUnit unit)
           
 long getDelay(TimeUnit unit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 void release()
           
 void run()
           
(package private)  void setDelegateScheduledFuture(ScheduledFuture<T> delegateScheduledFuture)
           
(package private)  void setException(Exception e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkCallableFutureAdapter

public WorkCallableFutureAdapter(Callable<T> callable)

WorkCallableFutureAdapter

public WorkCallableFutureAdapter(Runnable runnable)
Method Detail

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-2009 The Compass Project.