|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.core.service.AbstractIoService
org.apache.mina.core.service.AbstractIoConnector
public abstract class AbstractIoConnector
A base implementation of IoConnector.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoService |
|---|
AbstractIoService.ServiceOperationFuture |
| Field Summary |
|---|
| Fields inherited from class org.apache.mina.core.service.AbstractIoService |
|---|
disposalLock |
| Constructor Summary | |
|---|---|
protected |
AbstractIoConnector(IoSessionConfig sessionConfig,
Executor executor)
Constructor for AbstractIoConnector. |
| 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 IoFutureListeners
related with event notifications to the specified session
and future. |
int |
getConnectTimeout()
Deprecated. Take a look at getConnectTimeoutMillis() |
long |
getConnectTimeoutCheckInterval()
Returns the minimum connection timeout value for this connector |
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)
Deprecated. Take a look at setConnectTimeoutMillis(long) |
void |
setConnectTimeoutCheckInterval(long minimumConnectTimeout)
|
void |
setConnectTimeoutMillis(long connectTimeoutInMillis)
Sets the connect timeout value in milliseconds. |
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 |
| Methods inherited from interface org.apache.mina.core.service.IoService |
|---|
addListener, broadcast, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getIdleState, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionConfig, getSessionDataStructureFactory, getStatistics, getTransportMetadata, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory |
| Constructor Detail |
|---|
protected AbstractIoConnector(IoSessionConfig sessionConfig,
Executor executor)
AbstractIoConnector. You need to provide a default
session configuration and an Executor for handling I/O events. If
null Executor is provided, a default one will be created using
Executors.newCachedThreadPool().
AbstractIoService.AbstractIoService(IoSessionConfig, Executor)
sessionConfig - the default configuration for the managed IoSessionexecutor - the Executor used for handling execution of I/O
events. Can be null.| Method Detail |
|---|
public long getConnectTimeoutCheckInterval()
public void setConnectTimeoutCheckInterval(long minimumConnectTimeout)
public final int getConnectTimeout()
IoConnector
getConnectTimeout in interface IoConnectorIoConnector.getConnectTimeoutMillis()public final long getConnectTimeoutMillis()
getConnectTimeoutMillis in interface IoConnectorpublic final void setConnectTimeout(int connectTimeout)
IoConnector
setConnectTimeout in interface IoConnectorsetConnectTimeoutMillis()public final void setConnectTimeoutMillis(long connectTimeoutInMillis)
setConnectTimeoutMillis in interface IoConnectorpublic SocketAddress getDefaultRemoteAddress()
IoConnector.connect() method.
getDefaultRemoteAddress in interface IoConnectorpublic final void setDefaultRemoteAddress(SocketAddress defaultRemoteAddress)
IoConnector.connect() method.
setDefaultRemoteAddress in interface IoConnectorpublic final ConnectFuture connect()
default remote address.
connect in interface IoConnectorpublic ConnectFuture connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
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 IoConnectorsessionInitializer - the callback to invoke when the IoSession object is createdpublic final ConnectFuture connect(SocketAddress remoteAddress)
connect in interface IoConnectorConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.
public ConnectFuture connect(SocketAddress remoteAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
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 IoConnectorremoteAddress - 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)
connect in interface IoConnectorConnectFuture 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)
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 IoConnectorremoteAddress - 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 specified
protected final void finishSessionInitialization0(IoSession session,
IoFuture future)
IoFutureListeners
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 AbstractIoServicepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||