hudson.remoting
Class AsyncFutureImpl<V>
java.lang.Object
hudson.remoting.AsyncFutureImpl<V>
- All Implemented Interfaces:
- java.util.concurrent.Future<V>
public class AsyncFutureImpl<V>
- extends java.lang.Object
- implements Future<V>
Future
implementation whose computation is carried out elsewhere.
Call the set(Object)
method or set(Throwable)
method to set the value to the future.
- Author:
- Kohsuke Kawaguchi
Method Summary |
boolean |
cancel(boolean mayInterruptIfRunning)
|
V |
get()
|
V |
get(long timeout,
java.util.concurrent.TimeUnit unit)
|
boolean |
isCancelled()
|
boolean |
isDone()
|
void |
set(java.lang.Throwable problem)
|
void |
set(V value)
|
void |
setAsCancelled()
Marks this task as cancelled. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncFutureImpl
public AsyncFutureImpl()
AsyncFutureImpl
public AsyncFutureImpl(V value)
AsyncFutureImpl
public AsyncFutureImpl(java.lang.Throwable value)
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface java.util.concurrent.Future<V>
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface java.util.concurrent.Future<V>
isDone
public boolean isDone()
- Specified by:
isDone
in interface java.util.concurrent.Future<V>
get
public V get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
- Specified by:
get
in interface java.util.concurrent.Future<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
get
public V get(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
- Specified by:
get
in interface java.util.concurrent.Future<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
set
public void set(V value)
set
public void set(java.lang.Throwable problem)
setAsCancelled
public void setAsCancelled()
- Marks this task as cancelled.
Copyright © 2012. All Rights Reserved.