<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:48:00 PST 2010 --> <TITLE> Futures (Guava Libraries 2010.01.04) </TITLE> <META NAME="date" CONTENT="2010-01-04"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Futures (Guava Libraries 2010.01.04)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Futures.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/common/util/concurrent/Futures.html" target="_top"><B>FRAMES</B></A> <A HREF="Futures.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.common.util.concurrent</FONT> <BR> Class Futures</H2> <PRE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.util.concurrent.Futures</B> </PRE> <HR> <DL> <DT><PRE>public class <B>Futures</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> </PRE> <P> Static utility methods pertaining to the <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A> interface. <P> <P> <DL> <DT><B>Since:</B></DT> <DD>2009.09.15 <b>tentative</b></DD> <DT><B>Author:</B></DT> <DD>Kevin Bourrillion, Nishant Thakkar, Sven Mawson</DD> </DL> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)">chain</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> input, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><? extends O>> function)</CODE> <BR> Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)">chain</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> input, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><? extends O>> function, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A> exec)</CODE> <BR> Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><I,O> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><O></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#compose(java.util.concurrent.Future, com.google.common.base.Function)">compose</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><I> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends O> function)</CODE> <BR> Creates a new <code>Future</code> that wraps another <code>Future</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#compose(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)">compose</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends O> function)</CODE> <BR> Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#compose(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)">compose</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends O> function, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A> exec)</CODE> <BR> Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>> <BR> <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><T,E></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateCheckedFuture(T)">immediateCheckedFuture</A></B>(T value)</CODE> <BR> Creates a <code>CheckedFuture</code> which has its value set immediately upon construction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>> <BR> <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><T,E></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateFailedCheckedFuture(E)">immediateFailedCheckedFuture</A></B>(E exception)</CODE> <BR> Creates a <code>CheckedFuture</code> which has an exception set immediately upon construction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><T></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateFailedFuture(java.lang.Throwable)">immediateFailedFuture</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A> throwable)</CODE> <BR> Creates a <code>ListenableFuture</code> which has an exception set immediately upon construction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><T></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateFuture(T)">immediateFuture</A></B>(T value)</CODE> <BR> Creates a <code>ListenableFuture</code> which has its value set immediately upon construction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>> <BR> <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><T,E></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeChecked(java.util.concurrent.Future, com.google.common.base.Function)">makeChecked</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><T> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>,E> mapper)</CODE> <BR> Creates a <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><CODE>CheckedFuture</CODE></A> out of a normal <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A> and a <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base"><CODE>Function</CODE></A> that maps from <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><CODE>Exception</CODE></A> instances into the appropriate checked type.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><T></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeListenable(java.util.concurrent.Future)">makeListenable</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><T> future)</CODE> <BR> Creates a <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A> out of a normal <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><V> <A HREF="../../../../../com/google/common/util/concurrent/UninterruptibleFuture.html" title="interface in com.google.common.util.concurrent">UninterruptibleFuture</A><V></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeUninterruptible(java.util.concurrent.Future)">makeUninterruptible</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><V> future)</CODE> <BR> Returns an uninterruptible view of a <code>Future</code>.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="makeUninterruptible(java.util.concurrent.Future)"><!-- --></A><H3> makeUninterruptible</H3> <PRE> public static <V> <A HREF="../../../../../com/google/common/util/concurrent/UninterruptibleFuture.html" title="interface in com.google.common.util.concurrent">UninterruptibleFuture</A><V> <B>makeUninterruptible</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><V> future)</PRE> <DL> <DD>Returns an uninterruptible view of a <code>Future</code>. If a thread is interrupted during an attempt to <code>get()</code> from the returned future, it continues to wait on the result until it is available or the timeout elapses, and only then re-interrupts the thread. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="makeListenable(java.util.concurrent.Future)"><!-- --></A><H3> makeListenable</H3> <PRE> public static <T> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><T> <B>makeListenable</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><T> future)</PRE> <DL> <DD>Creates a <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A> out of a normal <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A>. The returned future will create a thread to wait for the source future to complete before executing the listeners. <p>Callers who have a future that subclasses <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/FutureTask.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>FutureTask</CODE></A> may want to instead subclass <A HREF="../../../../../com/google/common/util/concurrent/ListenableFutureTask.html" title="class in com.google.common.util.concurrent"><CODE>ListenableFutureTask</CODE></A>, which adds the <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A> functionality to the standard <code>FutureTask</code> implementation. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="makeChecked(java.util.concurrent.Future, com.google.common.base.Function)"><!-- --></A><H3> makeChecked</H3> <PRE> public static <T,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>> <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><T,E> <B>makeChecked</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><T> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>,E> mapper)</PRE> <DL> <DD>Creates a <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><CODE>CheckedFuture</CODE></A> out of a normal <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A> and a <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base"><CODE>Function</CODE></A> that maps from <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><CODE>Exception</CODE></A> instances into the appropriate checked type. <p>The given mapping function will be applied to an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, a <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A>, or an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> with the actual cause of the exception. See <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> for details on the exceptions thrown. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="immediateFuture(java.lang.Object)"><!-- --></A><A NAME="immediateFuture(T)"><!-- --></A><H3> immediateFuture</H3> <PRE> public static <T> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><T> <B>immediateFuture</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT> T value)</PRE> <DL> <DD>Creates a <code>ListenableFuture</code> which has its value set immediately upon construction. The getters just return the value. This <code>Future</code> can't be canceled or timed out and its <code>isDone()</code> method always returns <code>true</code>. It's useful for returning something that implements the <code>ListenableFuture</code> interface but already has the result. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="immediateCheckedFuture(java.lang.Object)"><!-- --></A><A NAME="immediateCheckedFuture(T)"><!-- --></A><H3> immediateCheckedFuture</H3> <PRE> public static <T,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>> <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><T,E> <B>immediateCheckedFuture</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT> T value)</PRE> <DL> <DD>Creates a <code>CheckedFuture</code> which has its value set immediately upon construction. The getters just return the value. This <code>Future</code> can't be canceled or timed out and its <code>isDone()</code> method always returns <code>true</code>. It's useful for returning something that implements the <code>CheckedFuture</code> interface but already has the result. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="immediateFailedFuture(java.lang.Throwable)"><!-- --></A><H3> immediateFailedFuture</H3> <PRE> public static <T> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><T> <B>immediateFailedFuture</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A> throwable)</PRE> <DL> <DD>Creates a <code>ListenableFuture</code> which has an exception set immediately upon construction. The getters just return the value. This <code>Future</code> can't be canceled or timed out and its <code>isDone()</code> method always returns <code>true</code>. It's useful for returning something that implements the <code>ListenableFuture</code> interface but already has a failed result. Calling <code>get()</code> will throw the provided <code>Throwable</code> (wrapped in an <code>ExecutionException</code>). <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang">Error</A></CODE> - if the throwable was an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang"><CODE>Error</CODE></A>.</DL> </DD> </DL> <HR> <A NAME="immediateFailedCheckedFuture(java.lang.Exception)"><!-- --></A><A NAME="immediateFailedCheckedFuture(E)"><!-- --></A><H3> immediateFailedCheckedFuture</H3> <PRE> public static <T,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>> <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><T,E> <B>immediateFailedCheckedFuture</B>(E exception)</PRE> <DL> <DD>Creates a <code>CheckedFuture</code> which has an exception set immediately upon construction. The getters just return the value. This <code>Future</code> can't be canceled or timed out and its <code>isDone()</code> method always returns <code>true</code>. It's useful for returning something that implements the <code>CheckedFuture</code> interface but already has a failed result. Calling <code>get()</code> will throw the provided <code>Throwable</code> (wrapped in an <code>ExecutionException</code>) and calling <code>checkedGet()</code> will throw the provided exception itself. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang">Error</A></CODE> - if the throwable was an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang"><CODE>Error</CODE></A>.</DL> </DD> </DL> <HR> <A NAME="chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)"><!-- --></A><H3> chain</H3> <PRE> public static <I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O> <B>chain</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> input, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><? extends O>> function)</PRE> <DL> <DD>Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>. The result of the new future is the result of the provided function called on the result of the provided future. The resulting future doesn't interrupt when aborted. <p>TODO: Add a version that accepts a normal <code>Future</code> <p>The typical use for this method would be when a RPC call is dependent on the results of another RPC. One would call the first RPC (input), create a function that calls another RPC based on input's result, and then call chain on input and that function to get a <code>ListenableFuture</code> of the result. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>input</CODE> - The future to chain<DD><CODE>function</CODE> - A function to chain the results of the provided future to the results of the returned future. This will be run in the thread that notifies input it is complete. <DT><B>Returns:</B><DD>A future that holds result of the chain.</DL> </DD> </DL> <HR> <A NAME="chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)"><!-- --></A><H3> chain</H3> <PRE> public static <I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O> <B>chain</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> input, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><? extends O>> function, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A> exec)</PRE> <DL> <DD>Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>. The result of the new future is the result of the provided function called on the result of the provided future. The resulting future doesn't interrupt when aborted. <p>This version allows an arbitrary executor to be passed in for running the chained Function. When using <A HREF="../../../../../com/google/common/util/concurrent/Executors.html#sameThreadExecutor()"><CODE>Executors.sameThreadExecutor()</CODE></A>, the thread chained Function executes in will be whichever thread set the result of the input Future, which may be the network thread in the case of RPC-based Futures. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>input</CODE> - The future to chain<DD><CODE>function</CODE> - A function to chain the results of the provided future to the results of the returned future.<DD><CODE>exec</CODE> - Executor to run the function in. <DT><B>Returns:</B><DD>A future that holds result of the chain.</DL> </DD> </DL> <HR> <A NAME="compose(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)"><!-- --></A><H3> compose</H3> <PRE> public static <I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O> <B>compose</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends O> function)</PRE> <DL> <DD>Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>. The result of the new future is the result of the provided function called on the result of the provided future. The resulting future doesn't interrupt when aborted. <p>An example use of this method is to convert a serializable object returned from an RPC into a POJO. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>future</CODE> - The future to compose<DD><CODE>function</CODE> - A Function to compose the results of the provided future to the results of the returned future. This will be run in the thread that notifies input it is complete. <DT><B>Returns:</B><DD>A future that holds result of the composition.</DL> </DD> </DL> <HR> <A NAME="compose(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)"><!-- --></A><H3> compose</H3> <PRE> public static <I,O> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><O> <B>compose</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><I> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends O> function, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A> exec)</PRE> <DL> <DD>Creates a new <code>ListenableFuture</code> that wraps another <code>ListenableFuture</code>. The result of the new future is the result of the provided function called on the result of the provided future. The resulting future doesn't interrupt when aborted. <p>An example use of this method is to convert a serializable object returned from an RPC into a POJO. <p>This version allows an arbitrary executor to be passed in for running the chained Function. When using <A HREF="../../../../../com/google/common/util/concurrent/Executors.html#sameThreadExecutor()"><CODE>Executors.sameThreadExecutor()</CODE></A>, the thread chained Function executes in will be whichever thread set the result of the input Future, which may be the network thread in the case of RPC-based Futures. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>future</CODE> - The future to compose<DD><CODE>function</CODE> - A Function to compose the results of the provided future to the results of the returned future.<DD><CODE>exec</CODE> - Executor to run the function in. <DT><B>Returns:</B><DD>A future that holds result of the composition.<DT><B>Since:</B></DT> <DD>2010.01.04 <b>tentative</b></DD> </DL> </DD> </DL> <HR> <A NAME="compose(java.util.concurrent.Future, com.google.common.base.Function)"><!-- --></A><H3> compose</H3> <PRE> public static <I,O> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><O> <B>compose</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><I> future, <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A><? super I,? extends O> function)</PRE> <DL> <DD>Creates a new <code>Future</code> that wraps another <code>Future</code>. The result of the new future is the result of the provided function called on the result of the provided future. <p>An example use of this method is to convert a Future that produces a handle to an object to a future that produces the object itself. <p>Each call to <code>Future<O>.get(*)</code> results in a call to <code>Future<I>.get(*)</code>, but <code>function</code> is only applied once, so it is assumed that <code>Future<I>.get(*)</code> is idempotent. <p>When calling <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get(long, java.util.concurrent.TimeUnit)" title="class or interface in java.util.concurrent"><CODE>Future.get(long, TimeUnit)</CODE></A> on the returned future, the timeout only applies to the future passed in to this method. Any additional time taken by applying <code>function</code> is not considered. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>future</CODE> - The future to compose<DD><CODE>function</CODE> - A Function to compose the results of the provided future to the results of the returned future. This will be run in the thread that calls one of the varieties of <code>get()</code>. <DT><B>Returns:</B><DD>A future that computes result of the composition.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Futures.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/common/util/concurrent/Futures.html" target="_top"><B>FRAMES</B></A> <A HREF="Futures.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>