public class AsyncResult<T> extends Object implements IAsyncResult<T>
| Constructor and Description |
|---|
AsyncResult(ExecutorService pExecutorService,
ICommand<T> pImpl)
Executes command with custom callable.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Wait for result to be available and return them.
|
T |
get(long pTimeout,
TimeUnit pTimeUnit)
Wait for result to be available up until timeout specified.
|
void |
setCallback(Callback<T> pCallback)
Set "method" to be called when result is available.
|
public AsyncResult(ExecutorService pExecutorService, ICommand<T> pImpl)
pExecutorService - Executor ServicepImpl - Implementationpublic void setCallback(Callback<T> pCallback) throws Exception
IAsyncResultsetCallback in interface IAsyncResult<T>pCallback - CallbackException - Exceptionpublic T get() throws Exception
IAsyncResultget in interface IAsyncResult<T>Exception - Exceptionpublic T get(long pTimeout, TimeUnit pTimeUnit) throws Exception
IAsyncResultget in interface IAsyncResult<T>pTimeout - TimeoutpTimeUnit - Time unitException - Exceptionlpezet