public class DefaultConnectFuture extends DefaultIoFuture implements ConnectFuture
ConnectFuture.| Constructor and Description |
|---|
DefaultConnectFuture()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ConnectFuture |
addListener(IoFutureListener<?> listener)
Adds an event listener which is notified when
this future is completed.
|
ConnectFuture |
await()
Wait for the asynchronous operation to complete.
|
ConnectFuture |
awaitUninterruptibly()
Wait for the asynchronous operation to complete uninterruptibly.
|
void |
cancel()
Cancels the connection attempt and notifies all threads waiting for
this future.
|
Throwable |
getException()
Returns the cause of the connection failure.
|
IoSession |
getSession()
Returns the
IoSession which is associated with this future. |
boolean |
isCanceled()
Returns
true if the connect operation has been canceled by
ConnectFuture.cancel() method. |
boolean |
isConnected()
Returns true if the connect operation is finished successfully.
|
static ConnectFuture |
newFailedFuture(Throwable exception)
Returns a new
ConnectFuture which is already marked as 'failed to connect'. |
ConnectFuture |
removeListener(IoFutureListener<?> listener)
Removes an existing event listener so it won't be notified when
the future is completed.
|
void |
setException(Throwable exception)
Sets the exception caught due to connection failure and notifies all
threads waiting for this future.
|
void |
setSession(IoSession session)
Sets the newly connected session and notifies all threads waiting for
this future.
|
await, await, awaitUninterruptibly, awaitUninterruptibly, getValue, isDone, join, join, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitawait, await, awaitUninterruptibly, awaitUninterruptibly, isDone, join, joinpublic static ConnectFuture newFailedFuture(Throwable exception)
ConnectFuture which is already marked as 'failed to connect'.public IoSession getSession()
DefaultIoFutureIoSession which is associated with this future.getSession in interface ConnectFuturegetSession in interface IoFuturegetSession in class DefaultIoFuturepublic Throwable getException()
ConnectFuturegetException in interface ConnectFuturepublic boolean isConnected()
ConnectFutureisConnected in interface ConnectFuturepublic boolean isCanceled()
ConnectFuturetrue if the connect operation has been canceled by
ConnectFuture.cancel() method.isCanceled in interface ConnectFuturepublic void setSession(IoSession session)
ConnectFuturesetSession in interface ConnectFuturepublic void setException(Throwable exception)
ConnectFuturesetException in interface ConnectFuturepublic void cancel()
ConnectFuturecancel in interface ConnectFuturepublic ConnectFuture await() throws InterruptedException
DefaultIoFutureawait in interface ConnectFutureawait in interface IoFutureawait in class DefaultIoFutureInterruptedExceptionpublic ConnectFuture awaitUninterruptibly()
DefaultIoFutureawaitUninterruptibly in interface ConnectFutureawaitUninterruptibly in interface IoFutureawaitUninterruptibly in class DefaultIoFuturepublic ConnectFuture addListener(IoFutureListener<?> listener)
DefaultIoFutureaddListener in interface ConnectFutureaddListener in interface IoFutureaddListener in class DefaultIoFuturepublic ConnectFuture removeListener(IoFutureListener<?> listener)
DefaultIoFutureremoveListener in interface ConnectFutureremoveListener in interface IoFutureremoveListener in class DefaultIoFuture