Class FutureAdapter<T,U>
- java.lang.Object
-
- de.unistuttgart.isw.sfsc.commonjava.util.FutureAdapter<T,U>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFutureAdapter.ThrowingFunction<T,U>
-
Constructor Summary
Constructors Constructor Description FutureAdapter(FutureAdapter.ThrowingFunction<T,U> converter, Callable<U> errorHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)Uget()Uget(long timeout, TimeUnit unit)voidhandleError()voidhandleInput(T input)booleanisCancelled()booleanisDone()
-
-
-
Constructor Detail
-
FutureAdapter
public FutureAdapter(FutureAdapter.ThrowingFunction<T,U> converter, Callable<U> errorHandler)
-
-
Method Detail
-
handleInput
public void handleInput(T input)
-
handleError
public void handleError()
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<T>
-
get
public U get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public U get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-