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.
|
java.lang.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(java.lang.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(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, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
await, await, awaitUninterruptibly, awaitUninterruptibly, isDone, join, join
public static ConnectFuture newFailedFuture(java.lang.Throwable exception)
ConnectFuture
which is already marked as 'failed to connect'.public IoSession getSession()
DefaultIoFuture
IoSession
which is associated with this future.getSession
in interface ConnectFuture
getSession
in interface IoFuture
getSession
in class DefaultIoFuture
public java.lang.Throwable getException()
ConnectFuture
getException
in interface ConnectFuture
public boolean isConnected()
ConnectFuture
isConnected
in interface ConnectFuture
public boolean isCanceled()
ConnectFuture
true
if the connect operation has been canceled by
ConnectFuture.cancel()
method.isCanceled
in interface ConnectFuture
public void setSession(IoSession session)
ConnectFuture
setSession
in interface ConnectFuture
public void setException(java.lang.Throwable exception)
ConnectFuture
setException
in interface ConnectFuture
public void cancel()
ConnectFuture
cancel
in interface ConnectFuture
public ConnectFuture await() throws java.lang.InterruptedException
DefaultIoFuture
await
in interface ConnectFuture
await
in interface IoFuture
await
in class DefaultIoFuture
java.lang.InterruptedException
public ConnectFuture awaitUninterruptibly()
DefaultIoFuture
awaitUninterruptibly
in interface ConnectFuture
awaitUninterruptibly
in interface IoFuture
awaitUninterruptibly
in class DefaultIoFuture
public ConnectFuture addListener(IoFutureListener<?> listener)
DefaultIoFuture
addListener
in interface ConnectFuture
addListener
in interface IoFuture
addListener
in class DefaultIoFuture
public ConnectFuture removeListener(IoFutureListener<?> listener)
DefaultIoFuture
removeListener
in interface ConnectFuture
removeListener
in interface IoFuture
removeListener
in class DefaultIoFuture
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.