|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.future.DefaultIoFuture
org.apache.mina.core.future.DefaultConnectFuture
public class DefaultConnectFuture
A default implementation of ConnectFuture
.
Constructor Summary | |
---|---|
DefaultConnectFuture()
Creates a new instance. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.apache.mina.core.future.DefaultIoFuture |
---|
await, await, awaitUninterruptibly, awaitUninterruptibly, getValue, isDone, join, join, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.mina.core.future.IoFuture |
---|
await, await, awaitUninterruptibly, awaitUninterruptibly, isDone, join, join |
Constructor Detail |
---|
public DefaultConnectFuture()
Method Detail |
---|
public static ConnectFuture newFailedFuture(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 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(Throwable exception)
ConnectFuture
setException
in interface ConnectFuture
public void cancel()
ConnectFuture
cancel
in interface ConnectFuture
public ConnectFuture await() throws InterruptedException
DefaultIoFuture
await
in interface ConnectFuture
await
in interface IoFuture
await
in class DefaultIoFuture
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |