org.apache.mina.transport.socket.nio.support

Class DatagramAcceptorDelegate

Implemented Interfaces:
org.apache.mina.transport.socket.nio.support.DatagramService, IoAcceptor, IoService

public class DatagramAcceptorDelegate
extends BaseIoAcceptor
implements IoAcceptor, org.apache.mina.transport.socket.nio.support.DatagramService

IoAcceptor for datagram transport (UDP/IP).

Constructor Summary

DatagramAcceptorDelegate(IoAcceptor wrapper, Executor executor)
Creates a new instance.

Method Summary

@Override
IoServiceListenerSupport getListeners()
@Override
IoSession newSession(SocketAddress remoteAddress, SocketAddress localAddress)
void
bind(SocketAddress address, IoHandler handler, IoServiceConfig config)
Binds to the specified address and handles incoming connections with the specified handler.
void
closeSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to close the specified session.
void
flushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to flush the write buffer of the specified session.
DatagramAcceptorConfig
getDefaultConfig()
void
setDefaultConfig(DatagramAcceptorConfig defaultConfig)
Sets the config this acceptor will use by default.
void
unbind(SocketAddress address)
Unbinds from the specified address and disconnects all clients connected there.
void
unbindAll()
Unbinds all addresses which were bound by this acceptor.
void
updateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to update the traffic mask for the specified session.

Methods inherited from class org.apache.mina.common.support.BaseIoAcceptor

bind, newSession

Methods inherited from class org.apache.mina.common.support.BaseIoService

addListener, getFilterChain, getFilterChainBuilder, getListeners, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder

Constructor Details

DatagramAcceptorDelegate

public DatagramAcceptorDelegate(IoAcceptor wrapper,
                                Executor executor)
Creates a new instance.

Method Details

IoServiceListenerSupport getListeners

public @Override IoServiceListenerSupport getListeners()

IoSession newSession

public @Override IoSession newSession(SocketAddress remoteAddress,
                                      SocketAddress localAddress)

bind

public void bind(SocketAddress address,
                 IoHandler handler,
                 IoServiceConfig config)
            throws IOException
Binds to the specified address and handles incoming connections with the specified handler.
Specified by:
bind in interface IoAcceptor
Parameters:
config - the configuration

closeSession

public void closeSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to close the specified session. This method is invoked by MINA internally.
Specified by:
closeSession in interface org.apache.mina.transport.socket.nio.support.DatagramService

flushSession

public void flushSession(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to flush the write buffer of the specified session. This method is invoked by MINA internally.
Specified by:
flushSession in interface org.apache.mina.transport.socket.nio.support.DatagramService

getDefaultConfig

public DatagramAcceptorConfig getDefaultConfig()
Specified by:
getDefaultConfig in interface IoService

setDefaultConfig

public void setDefaultConfig(DatagramAcceptorConfig defaultConfig)
Sets the config this acceptor will use by default.
Parameters:
defaultConfig - the default config.

unbind

public void unbind(SocketAddress address)
Unbinds from the specified address and disconnects all clients connected there.
Specified by:
unbind in interface IoAcceptor

unbindAll

public void unbindAll()
Unbinds all addresses which were bound by this acceptor.
Specified by:
unbindAll in interface IoAcceptor

updateTrafficMask

public void updateTrafficMask(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
Requests this processor to update the traffic mask for the specified session. This method is invoked by MINA internally.
Specified by:
updateTrafficMask in interface org.apache.mina.transport.socket.nio.support.DatagramService