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.Invocable<R>, Promise.Task<T>, Promise.Wrapper<W>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) void
Callback invoked when the operation fails.get()
Return the result if completed successfully or in the case of failure, throw the Exception/Error, or an ExecutionException wrapping the cause if it is neither an Exception or Error.boolean
boolean
isDone()
static void
void
Callback invoked when the operation completes.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.Promise
completeWith
-
Constructor Details
-
FuturePromise
public FuturePromise() -
FuturePromise
-
FuturePromise
-
-
Method Details
-
succeeded
Description copied from interface:Promise
Callback invoked when the operation completes.
-
failed
Description copied from interface:Promise
Callback invoked when the operation fails.
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<C>
-
isDone
public boolean isDone() -
get
- Specified by:
get
in interfaceFuture<C>
- Throws:
InterruptedException
ExecutionException
-
getOrThrow
Return the result if completed successfully or in the case of failure, throw the Exception/Error, or an ExecutionException wrapping the cause if it is neither an Exception or Error.- Returns:
- the computed result
- Throws:
Exception
- if the cause is an Exception or Error, otherwise an ExecutionException wrapping the cause
-
get
public C get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<C>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
rethrow
- Throws:
IOException
-
toString
-