Package org.eclipse.jetty.util
Class FuturePromise<C>
- java.lang.Object
-
- org.eclipse.jetty.util.FuturePromise<C>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Promise
Promise.Adapter<U>, Promise.Completable<S>, Promise.Wrapper<W>
-
-
Constructor Summary
Constructors Constructor Description FuturePromise()FuturePromise(C result)FuturePromise(C ctx, Throwable failed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)voidfailed(Throwable cause)Callback invoked when the operation fails.Cget()Cget(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()static voidrethrow(ExecutionException e)voidsucceeded(C result)Callback invoked when the operation completes.StringtoString()
-
-
-
Method Detail
-
succeeded
public void succeeded(C result)
Description copied from interface:PromiseCallback invoked when the operation completes.
- Specified by:
succeededin interfacePromise<C>- Parameters:
result- the context- See Also:
Promise.failed(Throwable)
-
failed
public void failed(Throwable cause)
Description copied from interface:PromiseCallback invoked when the operation fails.
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<C>
-
get
public C get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<C>- Throws:
InterruptedExceptionExecutionException
-
get
public C get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<C>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
rethrow
public static void rethrow(ExecutionException e) throws IOException
- Throws:
IOException
-
-