|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- specific wrapping class of particular configuration objects typepublic interface AsyncRequestResult<T extends ICfgObject>
A AsyncRequestResult as an extension of Future represents the result of an asynchronous read operation of configuration data. Methods are provided to check if the read operation is complete, to wait for its completion, and to retrieve the result of the operation. The result can only be retrieved using method get when the read operation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. Additional methods are provided to determine if the task completed normally or was canceled. Once an operation has completed, it cannot be canceled.
Method Summary | |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Attempts to cancel execution of this task. |
java.util.Collection<T> |
get()
Waits if necessary for the read operation to complete, and then returns its result. |
java.util.Collection<T> |
get(long timeout,
java.util.concurrent.TimeUnit unit)
Waits if necessary for at most the given time for the request to complete, and then returns its result, if available. |
java.lang.Exception |
getException()
This function returns raised exception when operation is failed. |
boolean |
isCancelled()
Returns true if this task was canceled before it completed normally. |
boolean |
isCompletedSynchronously()
|
boolean |
isDone()
Returns true if this task completed. |
boolean |
isFailed()
Returns true if this task finished with some error. |
java.util.Collection<T> |
partialGet()
Returns accumulated read data immediately. |
Method Detail |
---|
boolean isDone()
isDone
in interface java.util.concurrent.Future<java.util.Collection<T extends ICfgObject>>
boolean isFailed()
boolean isCompletedSynchronously()
java.lang.Exception getException()
boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<java.util.Collection<T extends ICfgObject>>
mayInterruptIfRunning
- true if the thread executing this
task should be interrupted;
otherwise, in-progress tasks are allowed to complete
boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<java.util.Collection<T extends ICfgObject>>
java.util.Collection<T> get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<java.util.Collection<T extends ICfgObject>>
java.util.concurrent.CancellationException
- if the computation was canceled
java.util.concurrent.ExecutionException
- if the computation threw an
exception
java.lang.InterruptedException
- if the current thread was interrupted
while waitingjava.util.Collection<T> get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<java.util.Collection<T extends ICfgObject>>
timeout
- the maximum time to waitunit
- the time unit of the timeout argument
java.util.concurrent.CancellationException
- if the computation was canceled
java.util.concurrent.ExecutionException
- if the computation threw an
exception
java.util.concurrent.TimeoutException
- if the wait timed out
java.lang.InterruptedException
- if the current thread was interrupted
while waitingjava.util.Collection<T> partialGet()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |