T - The type of the object to be returned by the specified
MD-SAL transaction task.public final class TxSyncFuture<T> extends AbstractVTNFuture<T>
VTNFuture used to wait for completion of all
MD-SAL transaction tasks, including background tasks started by the target
task.
This class returns the value returned by the specified MD-SAL transaction task. Note that this future returns a value as long as the specified MD-SAL transaction has successfully completed.
Cancellation of the target MD-SAL transaction task is not supported.
cancel(boolean) only cancels a rendezvous with additional
background tasks started by the target MD-SAL transaction task.
| Constructor and Description |
|---|
TxSyncFuture(TxTask<T> task,
VTNFuture<T> f)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean intr)
Attempt to cancel execution of the task.
|
T |
get()
Wait for the task to complete, and then return the result of the task.
|
T |
get(long timeout,
TimeUnit unit)
Wait for the task to complete, and then return the result of the task.
|
boolean |
isCancelled()
Determine whether the task was canceled before it completed normally.
|
boolean |
isDone()
Determine whether the task completed or not.
|
addListener, done, getCause, getExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckedGet, checkedGetpublic boolean cancel(boolean intr)
Note that this method cancels only a rendezvous with additional background tasks, and never cancels the target MD-SAL transaction task.
intr - Unused because this future is designed to run using
callback.false is always returned because the target MD-SAL
transaction task will never be canceled.public boolean isCancelled()
false is always returned because the target MD-SAL
transaction task will never be canceled.public boolean isDone()
true only if the task completed.public T get() throws InterruptedException, ExecutionException
InterruptedException - The current thread was interrupted while waiting.ExecutionException - The task caught an exception.public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
timeout - The maximum time to waitunit - The time unit of timeout.InterruptedException - The current thread was interrupted while waiting.ExecutionException - The task caught an exception.TimeoutException - The task did not complete within the given timeout.Copyright © 2018 OpenDaylight. All rights reserved.