Package hudson.remoting
Class AsyncFutureImpl<V>
- java.lang.Object
-
- hudson.remoting.AsyncFutureImpl<V>
-
public class AsyncFutureImpl<V> extends Object implements Future<V>
Future
implementation whose computation is carried out elsewhere. Call theset(Object)
method orset(Throwable)
method to set the value to the future.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description AsyncFutureImpl()
AsyncFutureImpl(Throwable value)
AsyncFutureImpl(V value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean mayInterruptIfRunning)
V
get()
V
get(long timeout, TimeUnit unit)
boolean
isCancelled()
boolean
isDone()
void
set(Throwable problem)
void
set(V value)
void
setAsCancelled()
Marks this task as cancelled.
-
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceFuture<V>
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
@CheckForNull public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
set
public void set(V value)
-
set
public void set(Throwable problem)
-
setAsCancelled
public void setAsCancelled()
Marks this task as cancelled.
-
-