Package org.apache.mina.common.support
Class BaseIoAcceptor
- java.lang.Object
-
- org.apache.mina.common.support.BaseIoService
-
- org.apache.mina.common.support.BaseIoAcceptor
-
- All Implemented Interfaces:
IoAcceptor
,IoService
- Direct Known Subclasses:
DatagramAcceptorDelegate
,SocketAcceptor
,VmPipeAcceptor
public abstract class BaseIoAcceptor extends BaseIoService implements IoAcceptor
A base implementation ofIoAcceptor
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseIoAcceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(java.net.SocketAddress address, IoHandler handler)
Binds to the specifiedaddress
and handles incoming connections with the specifiedhandler
.IoSession
newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
(Optional) Returns anIoSession
that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound byIoAcceptor
viaIoAcceptor.bind(SocketAddress, IoHandler)
.-
Methods inherited from class org.apache.mina.common.support.BaseIoService
addListener, getFilterChain, getFilterChainBuilder, getListeners, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.mina.common.IoAcceptor
bind, unbind, unbindAll
-
Methods inherited from interface org.apache.mina.common.IoService
addListener, getDefaultConfig, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
-
-
-
-
Method Detail
-
bind
public void bind(java.net.SocketAddress address, IoHandler handler) throws java.io.IOException
Description copied from interface:IoAcceptor
Binds to the specifiedaddress
and handles incoming connections with the specifiedhandler
.- Specified by:
bind
in interfaceIoAcceptor
- Throws:
java.io.IOException
- if failed to bind
-
newSession
public IoSession newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Description copied from interface:IoAcceptor
(Optional) Returns anIoSession
that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound byIoAcceptor
viaIoAcceptor.bind(SocketAddress, IoHandler)
.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.- Specified by:
newSession
in interfaceIoAcceptor
-
-