Class DatagramAcceptorDelegate
- java.lang.Object
-
- org.apache.mina.common.support.BaseIoService
-
- org.apache.mina.common.support.BaseIoAcceptor
-
- org.apache.mina.transport.socket.nio.support.DatagramAcceptorDelegate
-
- All Implemented Interfaces:
IoAcceptor,IoService
public class DatagramAcceptorDelegate extends BaseIoAcceptor implements IoAcceptor
IoAcceptorfor datagram transport (UDP/IP).
-
-
Constructor Summary
Constructors Constructor Description DatagramAcceptorDelegate(IoAcceptor wrapper, java.util.concurrent.Executor executor)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config)Binds to the specifiedaddressand handles incoming connections with the specifiedhandler.voidcloseSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)voidflushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)DatagramAcceptorConfiggetDefaultConfig()Returns the default configuration which is used when you didn't specify any configuration.IoServiceListenerSupportgetListeners()IoSessionnewSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)(Optional) Returns anIoSessionthat is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound byIoAcceptorviaIoAcceptor.bind(SocketAddress, IoHandler).voidsetDefaultConfig(DatagramAcceptorConfig defaultConfig)Sets the config this acceptor will use by default.voidunbind(java.net.SocketAddress address)Unbinds from the specifiedaddressand disconnects all clients connected there.voidunbindAll()Unbinds all addresses which were bound by this acceptor.voidupdateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)-
Methods inherited from class org.apache.mina.common.support.BaseIoAcceptor
bind
-
Methods inherited from class org.apache.mina.common.support.BaseIoService
addListener, getFilterChain, getFilterChainBuilder, 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
-
Methods inherited from interface org.apache.mina.common.IoService
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
-
-
-
-
Constructor Detail
-
DatagramAcceptorDelegate
public DatagramAcceptorDelegate(IoAcceptor wrapper, java.util.concurrent.Executor executor)
Creates a new instance.
-
-
Method Detail
-
bind
public void bind(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config) throws java.io.IOExceptionDescription copied from interface:IoAcceptorBinds to the specifiedaddressand handles incoming connections with the specifiedhandler.- Specified by:
bindin interfaceIoAcceptorconfig- the configuration- Throws:
java.io.IOException- if failed to bind
-
unbind
public void unbind(java.net.SocketAddress address)
Description copied from interface:IoAcceptorUnbinds from the specifiedaddressand disconnects all clients connected there.- Specified by:
unbindin interfaceIoAcceptor
-
unbindAll
public void unbindAll()
Description copied from interface:IoAcceptorUnbinds all addresses which were bound by this acceptor.- Specified by:
unbindAllin interfaceIoAcceptor
-
newSession
public IoSession newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Description copied from interface:IoAcceptor(Optional) Returns anIoSessionthat is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound byIoAcceptorviaIoAcceptor.bind(SocketAddress, IoHandler).This operation is optional. Please throw
UnsupportedOperationExceptionif the transport type doesn't support this operation. This operation is usually implemented for connectionless transport types.- Specified by:
newSessionin interfaceIoAcceptor- Overrides:
newSessionin classBaseIoAcceptor
-
getListeners
public IoServiceListenerSupport getListeners()
- Overrides:
getListenersin classBaseIoService
-
getDefaultConfig
public DatagramAcceptorConfig getDefaultConfig()
Description copied from interface:IoServiceReturns the default configuration which is used when you didn't specify any configuration.- Specified by:
getDefaultConfigin interfaceIoService
-
setDefaultConfig
public void setDefaultConfig(DatagramAcceptorConfig defaultConfig)
Sets the config this acceptor will use by default.- Parameters:
defaultConfig- the default config.- Throws:
java.lang.NullPointerException- if the specified value isnull.
-
flushSession
public void flushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
-
closeSession
public void closeSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
-
updateTrafficMask
public void updateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
-
-