Package org.apache.sshd.common.future
Interface WaitableFuture
-
- All Known Subinterfaces:
CloseFuture,IoConnectFuture,IoReadFuture,IoWriteFuture,SshFuture<T>
- All Known Implementing Classes:
AbstractIoWriteFuture,AbstractSshFuture,DefaultCloseFuture,DefaultSshFuture,DefaultVerifiableSshFuture
public interface WaitableFutureRepresents an asynchronous operation which one can wait for its completion. Note: the only thing guaranteed is that iftrueis returned from one of theawaitXXXmethods then the operation has completed. However, the caller has to determine whether it was a successful or failed completion.- Author:
- Apache MINA SSHD Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanawait()WaitLong.MAX_VALUEmsec.booleanawait(long timeoutMillis)Wait for the asynchronous operation to complete with the specified timeout.default booleanawait(long timeout, TimeUnit unit)Wait for the asynchronous operation to complete with the specified timeout.default booleanawait(Duration timeout)Wait for the asynchronous operation to complete with the specified timeout.default booleanawaitUninterruptibly()WaitLong.MAX_VALUEmsec.booleanawaitUninterruptibly(long timeoutMillis)Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.default booleanawaitUninterruptibly(long timeout, TimeUnit unit)Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.default booleanawaitUninterruptibly(Duration timeoutMillis)Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.ObjectgetId()booleanisDone()
-
-
-
Method Detail
-
getId
Object getId()
- Returns:
- Some identifier useful as
toString()value
-
await
default boolean await() throws IOExceptionWaitLong.MAX_VALUEmsec. for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.- Returns:
trueif the operation is completed.- Throws:
IOException- if failed - specificallyInterruptedIOExceptionif waiting was interrupted- See Also:
await(long)
-
await
default boolean await(long timeout, TimeUnit unit) throws IOExceptionWait for the asynchronous operation to complete with the specified timeout.- Parameters:
timeout- The number of time units to waitunit- TheTimeUnitfor waiting- Returns:
trueif the operation is completed.- Throws:
IOException- if failed - specificallyInterruptedIOExceptionif waiting was interrupted- See Also:
await(long)
-
await
default boolean await(Duration timeout) throws IOException
Wait for the asynchronous operation to complete with the specified timeout.- Parameters:
timeout- The maximum duration to wait,nullto wait forever- Returns:
trueif the operation is completed.- Throws:
IOException- if failed - specificallyInterruptedIOExceptionif waiting was interrupted- See Also:
await(long)
-
await
boolean await(long timeoutMillis) throws IOExceptionWait for the asynchronous operation to complete with the specified timeout.- Parameters:
timeoutMillis- Wait time in milliseconds- Returns:
trueif the operation is completed.- Throws:
IOException- if failed - specificallyInterruptedIOExceptionif waiting was interrupted
-
awaitUninterruptibly
default boolean awaitUninterruptibly()
WaitLong.MAX_VALUEmsec. for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.- Returns:
trueif the operation is completed.- See Also:
awaitUninterruptibly(long)
-
awaitUninterruptibly
default boolean awaitUninterruptibly(long timeout, TimeUnit unit)Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Parameters:
timeout- The number of time units to waitunit- TheTimeUnitfor waiting- Returns:
trueif the operation is completed.- See Also:
awaitUninterruptibly(long)
-
awaitUninterruptibly
default boolean awaitUninterruptibly(Duration timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Parameters:
timeoutMillis- Wait time,nullto wait forever- Returns:
trueif the operation is finished.
-
awaitUninterruptibly
boolean awaitUninterruptibly(long timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Parameters:
timeoutMillis- Wait time in milliseconds- Returns:
trueif the operation is finished.
-
isDone
boolean isDone()
- Returns:
trueif the asynchronous operation is completed. Note: it is up to the caller to determine whether it was a successful or failed completion.
-
-