|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConnectFuture
An IoFuture
for asynchronous connect requests.
IoConnector connector = ...; ConnectFuture future = connector.connect(...); future.join(); // Wait until the connection attempt is finished. IoSession session = future.getSession(); session.write(...);
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 IoSession which is the result of connect operation. |
boolean |
isCanceled()
Returns true if the connect operation has been canceled by
cancel() method. |
boolean |
isConnected()
Returns true if the connect operation is finished successfully. |
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 interface org.apache.mina.core.future.IoFuture |
---|
await, await, awaitUninterruptibly, awaitUninterruptibly, isDone, join, join |
Method Detail |
---|
IoSession getSession()
IoSession
which is the result of connect operation.
getSession
in interface IoFuture
RuntimeException
- if connection attempt failed by an exceptionThrowable getException()
boolean isConnected()
boolean isCanceled()
true
if the connect operation has been canceled by
cancel()
method.
void setSession(IoSession session)
void setException(Throwable exception)
void cancel()
ConnectFuture await() throws InterruptedException
IoFuture
await
in interface IoFuture
InterruptedException
ConnectFuture awaitUninterruptibly()
IoFuture
awaitUninterruptibly
in interface IoFuture
ConnectFuture addListener(IoFutureListener<?> listener)
IoFuture
addListener
in interface IoFuture
ConnectFuture removeListener(IoFutureListener<?> listener)
IoFuture
removeListener
in interface IoFuture
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |