org.apache.mina.common
Interface ConnectFuture
- IoFuture
- DefaultConnectFuture
public interface ConnectFuture
An
IoFuture
for asynchronous connect requests.
Example
IoConnector connector = ...;
ConnectFuture future = connector.connect(...);
future.join(); // Wait until the connection attempt is finished.
IoSession session = future.getSession();
session.write(...);
IoSession | getSession() - Returns
IoSession which is the result of connect operation.
|
boolean | isConnected() - Returns true if the connect operation is finished successfully.
|
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.
|
isConnected
public boolean isConnected()
Returns true if the connect operation is finished successfully.
setException
public void setException(Throwable exception)
Sets the exception caught due to connection failure and notifies all
threads waiting for this future. This method is invoked by MINA
internally. Please do not call this method directly.
setSession
public void setSession(IoSession session)
Sets the newly connected session and notifies all threads waiting for
this future. This method is invoked by MINA internally. Please do not
call this method directly.