|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ProtocolAcceptor
Accepts incoming connection, communicates with clients, and fires events to
ProtocolHandler
s.
Please refer to Reverser example.
You should bind to the desired socket address to accept incoming
connections, and then events for incoming connections will be sent to
the specified default ProtocolHandler
.
Threads accept incoming connections start automatically when
bind(SocketAddress, ProtocolProvider)
is invoked, and stop when all
addresses are unbound.
Method Summary | |
---|---|
void |
bind(SocketAddress address,
ProtocolProvider protocolProvider)
Binds to the specified address and handles incoming
connections with the specified protocolProvider . |
ProtocolSession |
newSession(SocketAddress remoteAddress,
SocketAddress localAddress)
(Optional) Returns a ProtocolSession that is bound to the specified
localAddress and remoteAddress which reuses
the localAddress that is already bound by ProtocolAcceptor
via bind(SocketAddress, ProtocolProvider) . |
void |
unbind(SocketAddress address)
Unbinds from the specified address . |
Methods inherited from interface org.apache.mina.protocol.ProtocolSessionManager |
---|
getFilterChain |
Methods inherited from interface org.apache.mina.common.SessionManager |
---|
getExceptionMonitor, setExceptionMonitor |
Method Detail |
---|
void bind(SocketAddress address, ProtocolProvider protocolProvider) throws IOException
address
and handles incoming
connections with the specified protocolProvider
.
IOException
- if failed to bindvoid unbind(SocketAddress address)
address
.
ProtocolSession newSession(SocketAddress remoteAddress, SocketAddress localAddress)
ProtocolSession
that is bound to the specified
localAddress and remoteAddress which reuses
the localAddress that is already bound by ProtocolAcceptor
via bind(SocketAddress, ProtocolProvider)
.
This operation is optional. Please throw UnsupportedOperationException
if the transport type doesn't support this operation. This operation is
usually implemented for connectionless transport types.
UnsupportedOperationException
- if this operation is not supported
IllegalArgumentException
- if the specified localAddress is
not bound yet. (see bind(SocketAddress, ProtocolProvider)
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |