Package org.eclipse.jetty.util
Class FutureCallback
- java.lang.Object
-
- org.eclipse.jetty.util.FutureCallback
-
- Direct Known Subclasses:
FutureWriteCallback
public class FutureCallback extends java.lang.Object implements java.util.concurrent.Future<java.lang.Void>, Callback
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, Callback.Nested
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.InvocationType
-
-
Field Summary
Fields Modifier and Type Field Description static FutureCallback
SUCCEEDED
-
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking
-
-
Constructor Summary
Constructors Constructor Description FutureCallback()
FutureCallback(boolean completed)
FutureCallback(java.lang.Throwable failed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean mayInterruptIfRunning)
void
failed(java.lang.Throwable cause)
Callback invoked when the operation fails.java.lang.Void
get()
java.lang.Void
get(long timeout, java.util.concurrent.TimeUnit unit)
boolean
isCancelled()
boolean
isDone()
static void
rethrow(java.util.concurrent.ExecutionException e)
void
succeeded()
Callback invoked when the operation completes.java.lang.String
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.thread.Invocable
getInvocationType
-
-
-
-
Field Detail
-
SUCCEEDED
public static final FutureCallback SUCCEEDED
-
-
Method Detail
-
succeeded
public void succeeded()
Description copied from interface:Callback
Callback invoked when the operation completes.
- Specified by:
succeeded
in interfaceCallback
- See Also:
Callback.failed(Throwable)
-
failed
public void failed(java.lang.Throwable cause)
Description copied from interface:Callback
Callback invoked when the operation fails.
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interfacejava.util.concurrent.Future<java.lang.Void>
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfacejava.util.concurrent.Future<java.lang.Void>
-
isDone
public boolean isDone()
- Specified by:
isDone
in interfacejava.util.concurrent.Future<java.lang.Void>
-
get
public java.lang.Void get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Specified by:
get
in interfacejava.util.concurrent.Future<java.lang.Void>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
get
public java.lang.Void get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Specified by:
get
in interfacejava.util.concurrent.Future<java.lang.Void>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
rethrow
public static void rethrow(java.util.concurrent.ExecutionException e) throws java.io.IOException
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-