T - The return type of the internal future.public abstract class AbstractSynchronizationFuture<T> extends Object implements Future<T>
| Constructor and Description |
|---|
AbstractSynchronizationFuture(Future<T> internalFuture,
DataProvider dataProvider) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addObserver(Observer observer)
Called to add an observer to the component whose synchronization is waited for
by this future.
|
protected abstract void |
beforeWaitForSynchronization()
Called before the synchronization task enters its loop.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected abstract boolean |
check(T message)
Called inside of the synchronization loop to check if the synchronization is complete.
|
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
Future<T> |
getInternalFuture() |
boolean |
isCancelled() |
boolean |
isDone() |
protected abstract void |
removeObserver(Observer observer)
Remove the notify change observer from the component whose synchronization is
waited for after the synchronization is complete or failed.
|
public AbstractSynchronizationFuture(Future<T> internalFuture, DataProvider dataProvider)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionprotected abstract void addObserver(Observer observer)
observer - In this case always the notify change observer that is added.protected abstract void removeObserver(Observer observer)
observer - In this case always the notify change observer that is added.protected abstract void beforeWaitForSynchronization()
throws CouldNotPerformException
CouldNotPerformException - if something goes wrongprotected abstract boolean check(T message) throws CouldNotPerformException
message - the return value of the internal futureCouldNotPerformException - it something goes wrong in the checkCopyright © 2015–2017 openbase.org. All rights reserved.