public class IoProtocolConnector extends java.lang.Object implements ProtocolConnector
ProtocolConnector
which wraps IoConnector
to provide
low-level I/O.
Please note that the user-defined attributes of ProtocolSession
and its wrapping IoSession
are shared.
Constructor and Description |
---|
IoProtocolConnector(IoConnector connector)
Creates a new instance with the specified
IoConnector . |
Modifier and Type | Method and Description |
---|---|
ProtocolSession |
connect(java.net.SocketAddress address,
int timeout,
ProtocolProvider provider)
Connects to the specified
address with timeout. |
ProtocolSession |
connect(java.net.SocketAddress address,
ProtocolProvider provider)
Connects to the specified
address . |
ProtocolSession |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
int timeout,
ProtocolProvider provider)
Connects to the specified
address with timeout. |
ProtocolSession |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
ProtocolProvider provider)
Connects to the specified
address . |
ExceptionMonitor |
getExceptionMonitor()
Returns the current exception monitor.
|
ProtocolFilterChain |
getFilterChain()
Returns the filter chain that filters all events which is related
with sessions this manager manages.
|
IoConnector |
getIoConnector()
Returns the underlying
IoConnector instance this acceptor is
wrapping. |
void |
setExceptionMonitor(ExceptionMonitor monitor)
Sets the uncaught exception monitor.
|
public IoProtocolConnector(IoConnector connector)
IoConnector
.public IoConnector getIoConnector()
IoConnector
instance this acceptor is
wrapping.public ProtocolSession connect(java.net.SocketAddress address, ProtocolProvider provider) throws java.io.IOException
ProtocolConnector
address
. If communication starts
successfully, events are fired to the specified
protocolProvider
. This method blocks.connect
in interface ProtocolConnector
java.io.IOException
- if failed to connectpublic ProtocolSession connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, ProtocolProvider provider) throws java.io.IOException
ProtocolConnector
address
. If communication starts
successfully, events are fired to the specified
protocolProvider
. This method blocks.connect
in interface ProtocolConnector
localAddress
- the local address the channel is bound tojava.io.IOException
- if failed to connectpublic ProtocolSession connect(java.net.SocketAddress address, int timeout, ProtocolProvider provider) throws java.io.IOException
ProtocolConnector
address
with timeout. If
communication starts successfully, events are fired to the specified
protocolProvider
. This method blocks.connect
in interface ProtocolConnector
java.io.IOException
- if failed to connectpublic ProtocolSession connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, int timeout, ProtocolProvider provider) throws java.io.IOException
ProtocolConnector
address
with timeout. If
communication starts successfully, events are fired to the specified
protocolProvider
. This method blocks.connect
in interface ProtocolConnector
localAddress
- the local address the channel is bound tojava.io.IOException
- if failed to connectpublic ProtocolFilterChain getFilterChain()
ProtocolSessionManager
getFilterChain
in interface ProtocolSessionManager
public ExceptionMonitor getExceptionMonitor()
SessionManager
getExceptionMonitor
in interface SessionManager
public void setExceptionMonitor(ExceptionMonitor monitor)
SessionManager
null
is specified,
a new instance of DefaultExceptionMonitor
will be set.setExceptionMonitor
in interface SessionManager
monitor
- A new instance of DefaultExceptionMonitor
is set
if null is specified.