org.ow2.sirocco.cloudmanager.connector.util
Class FutureWrapper<V,T>

java.lang.Object
  extended by org.ow2.sirocco.cloudmanager.connector.util.FutureWrapper<V,T>
All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<T>, Future<T>

public class FutureWrapper<V,T>
extends Object
implements com.google.common.util.concurrent.ListenableFuture<T>


Constructor Summary
FutureWrapper(com.google.common.util.concurrent.ListenableFuture<V> future, Converter<V,T> converter)
           
 
Method Summary
 void addListener(Runnable runnable, Executor exec)
           
 boolean cancel(boolean mayInterruptIfRunning)
           
 T get()
           
 T get(long timeout, TimeUnit unit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureWrapper

public FutureWrapper(com.google.common.util.concurrent.ListenableFuture<V> future,
                     Converter<V,T> converter)
Method Detail

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<T>

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

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<T>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<T>

addListener

public void addListener(Runnable runnable,
                        Executor exec)
Specified by:
addListener in interface com.google.common.util.concurrent.ListenableFuture<T>


Copyright © 2012 OW2 Consortium. All Rights Reserved.