SshFuture.
| Modifier and Type | Field and Description |
|---|---|
| private Object | |
| private final Object | lock
A lock used by the wait() method |
| private Object |
| Access | Constructor and Description |
|---|---|
| public | DefaultSshFuture(Object
Some identifier useful as id, Object toString() valueA synchronization object for locking access - if lock)null then synchronization occurs on
this instanceCreates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public T | addListener(SshFutureListener<T>
The listener)SshFutureListener instance to addImplements org. Adds an event listener which is notified when this future is completed. |
| protected Object | await0(long
The delay we will wait for the Future to be ready timeoutMillis, boolean Tells if the wait can be interrupted or not. If interruptable, CancelOption... true and the thread is
interrupted then an InterruptedIOException is thrown.Optional options)CancelOption defining the behavior on time-out or interrupt.Implements abstract org. Wait for the Future to be ready. |
| private CancelFuture | |
| protected CancelFuture | Returns: ACancelFuture that can be used to wait for the cancellation to have been effected, or
null if the future cannot be canceled.Creates a |
| public int | |
| public Object | |
| public boolean | |
| protected void | |
| protected void | onValueSet(Object
that was just set value)Callback that is invoked under lock when the future's value is set. |
| public T | removeListener(SshFutureListener<T>
The listener)SshFutureListener instance to removeImplements org. Removes an existing event listener so it won't be notified when the future is completed. |
| public void | |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| listeners | back to summary |
|---|---|
| private Object listeners | |
| lock | back to summary |
|---|---|
| private final Object lock A lock used by the wait() method | |
| result | back to summary |
|---|---|
| private Object result | |
| DefaultSshFuture | back to summary |
|---|---|
| public DefaultSshFuture(Object id, Object lock) Creates a new instance. | |
| addListener | back to summary |
|---|---|
| public T addListener(SshFutureListener<T> listener) Implements org. Doc from org. Adds an event listener which is notified when this future is completed. If the listener is added after the completion, the listener is directly notified.
| |
| await0 | back to summary |
|---|---|
| protected Object await0(long timeoutMillis, boolean interruptable, CancelOption... options) throws InterruptedIOException Implements abstract org. Doc from org. Wait for the Future to be ready. If the requested delay is 0 or negative, this method returns immediately.
| |
| cancelOnTimeout | back to summary |
|---|---|
| private CancelFuture cancelOnTimeout(long timeoutMillis, CancelOption... options) | |
| createCancellation | back to summary |
|---|---|
| protected CancelFuture createCancellation() Creates a This doesn't cancel this future yet.
| |
| getNumRegisteredListeners | back to summary |
|---|---|
| public int getNumRegisteredListeners() | |
| getValue | back to summary |
|---|---|
public Object getValue()
| |
| isDone | back to summary |
|---|---|
| public boolean isDone() Implements org.
| |
| notifyListeners | back to summary |
|---|---|
| protected void notifyListeners() | |
| onValueSet | back to summary |
|---|---|
| protected void onValueSet(Object value) Callback that is invoked under lock when the future's value is set.
As this is called under lock, subclasses should not do any elaborate processing. It is intended to give
subclasses a safe and convenient way to update local state before any listeners are invoked or callers waiting in
The default implementation does nothing.
| |
| removeListener | back to summary |
|---|---|
| public T removeListener(SshFutureListener<T> listener) Implements org. Doc from org. Removes an existing event listener so it won't be notified when the future is completed.
| |
| setValue | back to summary |
|---|---|
| public void setValue(Object newValue) Sets the result of the asynchronous operation, and mark it as finished.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |