D
- the result typepublic static class OortObject.Result.Deferred<D> extends Object implements OortObject.Result<D>
Implementation of OortObject.Result
that allows applications to block,
waiting for the result, via get(long, TimeUnit)
.
OortObject.Result.Deferred<D>
Constructor and Description |
---|
Deferred() |
Modifier and Type | Method and Description |
---|---|
D |
get(long time,
TimeUnit unit)
Waits for the result to be available for the specified amount of time.
|
void |
onResult(D result)
Callback method invoked when the result is available.
|
public void onResult(D result)
OortObject.Result
Callback method invoked when the result is available.
onResult
in interface OortObject.Result<D>
result
- the result objectpublic D get(long time, TimeUnit unit) throws InterruptedException, TimeoutException
Waits for the result to be available for the specified amount of time.
If the wait time elapses, a TimeoutException
is thrown, but this
method can be called again to wait more time for the result.
time
- the maximum time to waitunit
- the time unitInterruptedException
- if the thread is interrupted while waitingTimeoutException
- if the time elapses before the result is availableCopyright © 2008–2024 The CometD Project. All rights reserved.