|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.common.AbstractIoService
org.apache.mina.common.AbstractIoConnector
public abstract class AbstractIoConnector
A base implementation of IoConnector
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mina.common.AbstractIoService |
---|
AbstractIoService.ServiceOperationFuture |
Constructor Summary | |
---|---|
protected |
AbstractIoConnector(IoSessionConfig sessionConfig)
|
Method Summary | |
---|---|
ConnectFuture |
connect()
Connects to the default remote address . |
ConnectFuture |
connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Connects to the default
remote address and invokes the ioSessionInitializer when
the IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. |
ConnectFuture |
connect(SocketAddress remoteAddress)
Connects to the specified remote address. |
ConnectFuture |
connect(SocketAddress remoteAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Connects to the specified remote address and invokes the ioSessionInitializer when the IoSession is created but before
IoHandler.sessionCreated(IoSession) is invoked. |
ConnectFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connects to the specified remote address binding to the specified local address. |
ConnectFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Connects to the specified remote address binding to the specified local address and and invokes the ioSessionInitializer when the
IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. |
protected abstract ConnectFuture |
connect0(SocketAddress remoteAddress,
SocketAddress localAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Implement this method to perform the actual connect operation. |
protected void |
finishSessionInitialization0(IoSession session,
IoFuture future)
Adds required internal attributes and IoFutureListener s
related with event notifications to the specified session
and future . |
int |
getConnectTimeout()
Returns the connect timeout in seconds. |
long |
getConnectTimeoutMillis()
Returns the connect timeout in milliseconds. |
SocketAddress |
getDefaultRemoteAddress()
Returns the default remote address to connect to when no argument is specified in IoConnector.connect() method. |
void |
setConnectTimeout(int connectTimeout)
Sets the connect timeout in seconds. |
void |
setDefaultRemoteAddress(SocketAddress defaultRemoteAddress)
Sets the default remote address to connect to when no argument is specified in IoConnector.connect() method. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractIoConnector(IoSessionConfig sessionConfig)
Method Detail |
---|
public final int getConnectTimeout()
IoConnector
getConnectTimeout
in interface IoConnector
public final long getConnectTimeoutMillis()
IoConnector
getConnectTimeoutMillis
in interface IoConnector
public final void setConnectTimeout(int connectTimeout)
IoConnector
setConnectTimeout
in interface IoConnector
public SocketAddress getDefaultRemoteAddress()
IoConnector
IoConnector.connect()
method.
getDefaultRemoteAddress
in interface IoConnector
public final void setDefaultRemoteAddress(SocketAddress defaultRemoteAddress)
IoConnector
IoConnector.connect()
method.
setDefaultRemoteAddress
in interface IoConnector
public final ConnectFuture connect()
IoConnector
default remote address
.
connect
in interface IoConnector
public ConnectFuture connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
IoConnector
default
remote address
and invokes the ioSessionInitializer
when
the IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. There is no guarantee that the ioSessionInitializer
will be invoked before this method returns.
connect
in interface IoConnector
sessionInitializer
- the callback to invoke when the IoSession
object is createdpublic final ConnectFuture connect(SocketAddress remoteAddress)
IoConnector
connect
in interface IoConnector
ConnectFuture
instance which is completed when the
connection attempt initiated by this call succeeds or fails.public ConnectFuture connect(SocketAddress remoteAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
IoConnector
ioSessionInitializer
when the IoSession is created but before
IoHandler.sessionCreated(IoSession)
is invoked. There is no
guarantee that the ioSessionInitializer
will be invoked before
this method returns.
connect
in interface IoConnector
remoteAddress
- the remote address to connect tosessionInitializer
- the callback to invoke when the IoSession
object is created
ConnectFuture
instance which is completed when the
connection attempt initiated by this call succeeds or fails.public ConnectFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
IoConnector
connect
in interface IoConnector
ConnectFuture
instance which is completed when the
connection attempt initiated by this call succeeds or fails.public final ConnectFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
IoConnector
ioSessionInitializer
when the
IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. There is no guarantee that the ioSessionInitializer
will be invoked before this method returns.
connect
in interface IoConnector
remoteAddress
- the remote address to connect tolocalAddress
- the local interface to bind tosessionInitializer
- the callback to invoke when the IoSession
object is created
ConnectFuture
instance which is completed when the
connection attempt initiated by this call succeeds or fails.protected abstract ConnectFuture connect0(SocketAddress remoteAddress, SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
localAddress
- null if no local address is specifiedprotected final void finishSessionInitialization0(IoSession session, IoFuture future)
IoFutureListener
s
related with event notifications to the specified session
and future
. Do not call this method directly;
AbstractIoService.finishSessionInitialization(IoSession, IoFuture, IoSessionInitializer)
will call this method instead.
finishSessionInitialization0
in class AbstractIoService
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |