|
||||||||||
| 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()
DefaultIoFutureIoSession which is associated with this future.
getSession in interface ConnectFuturegetSession in interface IoFuturegetSession in class DefaultIoFuturepublic Throwable getException()
ConnectFuture
getException in interface ConnectFuturepublic boolean isConnected()
ConnectFuture
isConnected 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)
ConnectFuture
setSession in interface ConnectFuturepublic void setException(Throwable exception)
ConnectFuture
setException in interface ConnectFuturepublic void cancel()
ConnectFuture
cancel in interface ConnectFuture
public ConnectFuture await()
throws InterruptedException
DefaultIoFuture
await in interface ConnectFutureawait in interface IoFutureawait in class DefaultIoFutureInterruptedExceptionpublic ConnectFuture awaitUninterruptibly()
DefaultIoFuture
awaitUninterruptibly in interface ConnectFutureawaitUninterruptibly in interface IoFutureawaitUninterruptibly in class DefaultIoFuturepublic ConnectFuture addListener(IoFutureListener<?> listener)
DefaultIoFuture
addListener in interface ConnectFutureaddListener in interface IoFutureaddListener in class DefaultIoFuturepublic ConnectFuture removeListener(IoFutureListener<?> listener)
DefaultIoFuture
removeListener in interface ConnectFutureremoveListener in interface IoFutureremoveListener in class DefaultIoFuture
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||