org.jclouds.concurrent
Class Futures

java.lang.Object
  extended by org.jclouds.concurrent.Futures

@Beta
public class Futures
extends Object

functions related to or replacing those in Futures

Author:
Adrian Cole

Nested Class Summary
static class Futures.FutureListener<T>
           
static class Futures.LazyListenableFutureFunctionAdapter<I,O>
           
static class Futures.ListenableFutureAdapter<T>
           
 
Constructor Summary
Futures()
           
 
Method Summary
static
<I,O> com.google.common.util.concurrent.ListenableFuture<O>
compose(Future<I> future, com.google.common.base.Function<? super I,? extends O> function, ExecutorService executorService)
          Just like Futures#compose except that we check the type of the executorService before creating the Future.
static
<T> com.google.common.util.concurrent.ListenableFuture<T>
makeListenable(Future<T> future, ExecutorService executorService)
          Just like Futures#makeListenable except that we pass in an executorService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Futures

public Futures()
Method Detail

compose

public static <I,O> com.google.common.util.concurrent.ListenableFuture<O> compose(Future<I> future,
                                                                                  com.google.common.base.Function<? super I,? extends O> function,
                                                                                  ExecutorService executorService)
Just like Futures#compose except that we check the type of the executorService before creating the Future. If we are single threaded, invoke the function lazy as opposed to chaining, so that we don't invoke get() early.


makeListenable

public static <T> com.google.common.util.concurrent.ListenableFuture<T> makeListenable(Future<T> future,
                                                                                       ExecutorService executorService)
Just like Futures#makeListenable except that we pass in an executorService.

Temporary hack until http://code.google.com/p/guava-libraries/issues/detail?id=317 is fixed.



Copyright © 2009-2011 jclouds. All Rights Reserved.