|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.common.IoFuture
org.apache.mina.common.ConnectFuture
public class 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(...);
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mina.common.IoFuture |
---|
IoFuture.Callback |
Constructor Summary | |
---|---|
ConnectFuture()
|
|
ConnectFuture(Object lock)
Creates a new instance which uses the specified object as a lock. |
Method Summary | |
---|---|
IoSession |
getSession()
Returns IoSession which is the result of connect operation. |
boolean |
isConnected()
Returns true if the connect operation is finished successfully. |
static ConnectFuture |
newFailedFuture(IOException exception)
Returns a new ConnectFuture which is already marked as 'failed to connect'. |
void |
setException(Throwable exception)
This method is invoked by MINA internally. |
void |
setSession(IoSession session)
This method is invoked by MINA internally. |
Methods inherited from class org.apache.mina.common.IoFuture |
---|
getCallback, getLock, getValue, isReady, join, join, setCallback, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectFuture()
public ConnectFuture(Object lock)
Method Detail |
---|
public static ConnectFuture newFailedFuture(IOException exception)
ConnectFuture
which is already marked as 'failed to connect'.
public IoSession getSession() throws IOException
IoSession
which is the result of connect operation.
IOException
- if connection attempt failed by an exceptionpublic boolean isConnected()
public void setSession(IoSession session)
public void setException(Throwable exception)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |