public class DefaultConnectFuture extends DefaultIoFuture implements ConnectFuture
ConnectFuture.| 构造器和说明 |
|---|
DefaultConnectFuture()
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
boolean |
cancel()
Cancels the connection attempt and notifies all threads waiting for
this future.
|
java.lang.Throwable |
getException()
Returns the cause of the connection failure.
|
IoSession |
getSession() |
boolean |
isCanceled() |
boolean |
isConnected() |
static ConnectFuture |
newFailedFuture(java.lang.Throwable exception)
Creates a new instance of a Connection Failure, with the associated cause.
|
ConnectFuture |
removeListener(IoFutureListener<?> listener)
Removes an existing event listener so it won't be notified when
the future is completed.
|
void |
setException(java.lang.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(java.lang.Throwable exception)
exception - The exception that caused the failureConnectFuture which is already marked as 'failed to connect'.public IoSession getSession()
getSession 在接口中 ConnectFuturegetSession 在接口中 IoFuturegetSession 在类中 DefaultIoFutureIoSession which is associated with this future.public java.lang.Throwable getException()
getException 在接口中 ConnectFuturepublic boolean isConnected()
isConnected 在接口中 ConnectFuturetrue if the connect operation is finished successfully.public boolean isCanceled()
isCanceled 在接口中 ConnectFuturetrue if the connect operation has been canceled by
ConnectFuture.cancel() method.public void setSession(IoSession session)
setSession 在接口中 ConnectFuturesession - The created session to store in the ConnectFuture insteancepublic void setException(java.lang.Throwable exception)
setException 在接口中 ConnectFutureexception - The exception to store in the ConnectFuture instancepublic boolean cancel()
cancel 在接口中 ConnectFuturetrue if the future has been cancelled by this call, false
if the future was already cancelled.public ConnectFuture await() throws java.lang.InterruptedException
await 在接口中 ConnectFutureawait 在接口中 IoFutureawait 在类中 DefaultIoFuturejava.lang.InterruptedException - If the thread is interrupted while waitingpublic ConnectFuture awaitUninterruptibly()
awaitUninterruptibly 在接口中 ConnectFutureawaitUninterruptibly 在接口中 IoFutureawaitUninterruptibly 在类中 DefaultIoFuturepublic ConnectFuture addListener(IoFutureListener<?> listener)
addListener 在接口中 ConnectFutureaddListener 在接口中 IoFutureaddListener 在类中 DefaultIoFuturelistener - The listener to addpublic ConnectFuture removeListener(IoFutureListener<?> listener)
removeListener 在接口中 ConnectFutureremoveListener 在接口中 IoFutureremoveListener 在类中 DefaultIoFuturelistener - The listener to remove