public class DefaultConnectFuture extends DefaultIoFuture implements ConnectFuture
ConnectFuture.| 构造器和说明 |
|---|
DefaultConnectFuture()
Creates a new instance.
|
DefaultConnectFuture(java.lang.Object lock)
Creates a new instance which uses the specified object as a lock.
|
| 限定符和类型 | 方法和说明 |
|---|---|
IoSession |
getSession()
Returns the
IoSession which is associated with this future. |
boolean |
isConnected()
Returns true if the connect operation is finished successfully.
|
static ConnectFuture |
newFailedFuture(java.lang.Throwable exception)
Returns a new
ConnectFuture which is already marked as 'failed to connect'. |
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.
|
addListener, getLock, getValue, isReady, join, join, removeListener, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, getLock, isReady, join, join, removeListenerpublic DefaultConnectFuture()
public DefaultConnectFuture(java.lang.Object lock)
public static ConnectFuture newFailedFuture(java.lang.Throwable exception)
ConnectFuture which is already marked as 'failed to connect'.public IoSession getSession() throws RuntimeIOException
IoFutureIoSession which is associated with this future.getSession 在接口中 ConnectFuturegetSession 在接口中 IoFuturegetSession 在类中 DefaultIoFutureRuntimeIOException - if connection attempt failed by an exceptionpublic boolean isConnected()
ConnectFutureisConnected 在接口中 ConnectFuturepublic void setSession(IoSession session)
ConnectFuturesetSession 在接口中 ConnectFuturepublic void setException(java.lang.Throwable exception)
ConnectFuturesetException 在接口中 ConnectFuture