|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.service.AbstractIoService
org.apache.mina.core.service.AbstractIoAcceptor
org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor<S,H>
S
- the type of the IoSession
this processor can handlepublic abstract class AbstractPollingConnectionlessIoAcceptor<S extends AbstractIoSession,H>
IoAcceptor
for datagram transport (UDP/IP).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoAcceptor |
---|
AbstractIoAcceptor.AcceptorOperationFuture |
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoService |
---|
AbstractIoService.ServiceOperationFuture |
Field Summary |
---|
Fields inherited from class org.apache.mina.core.service.AbstractIoAcceptor |
---|
bindLock |
Fields inherited from class org.apache.mina.core.service.AbstractIoService |
---|
disposalLock |
Constructor Summary | |
---|---|
protected |
AbstractPollingConnectionlessIoAcceptor(IoSessionConfig sessionConfig)
Creates a new instance. |
protected |
AbstractPollingConnectionlessIoAcceptor(IoSessionConfig sessionConfig,
java.util.concurrent.Executor executor)
Creates a new instance. |
Method Summary | |
---|---|
void |
add(S session)
Adds the specified session to the I/O processor so that
the I/O processor starts to perform any I/O operations related
with the session . |
protected java.util.Set<java.net.SocketAddress> |
bindInternal(java.util.List<? extends java.net.SocketAddress> localAddresses)
Starts the acceptor, and register the given addresses |
protected abstract void |
close(H handle)
|
protected abstract void |
destroy()
|
protected void |
dispose0()
Implement this method to release any acquired resources. |
void |
flush(S session)
Flushes the internal write request queue of the specified session . |
IoSessionRecycler |
getSessionRecycler()
|
protected abstract void |
init()
|
protected abstract boolean |
isReadable(H handle)
|
protected abstract boolean |
isWritable(H handle)
|
protected abstract java.net.SocketAddress |
localAddress(H handle)
|
protected abstract S |
newSession(IoProcessor<S> processor,
H handle,
java.net.SocketAddress remoteAddress)
|
IoSession |
newSession(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
(Optional) Returns an IoSession that is bound to the specified
localAddress and the specified remoteAddress which
reuses the local address that is already bound by this service. |
protected abstract H |
open(java.net.SocketAddress localAddress)
|
protected abstract java.net.SocketAddress |
receive(H handle,
IoBuffer buffer)
|
void |
remove(S session)
Removes and closes the specified session from the I/O
processor so that the I/O processor closes the connection
associated with the session and releases any other related
resources. |
protected abstract int |
select()
|
protected abstract int |
select(long timeout)
|
protected abstract java.util.Set<java.nio.channels.SelectionKey> |
selectedHandles()
|
protected abstract int |
send(S session,
IoBuffer buffer,
java.net.SocketAddress remoteAddress)
|
protected abstract void |
setInterestedInWrite(S session,
boolean interested)
|
void |
setSessionRecycler(IoSessionRecycler sessionRecycler)
|
protected void |
unbind0(java.util.List<? extends java.net.SocketAddress> localAddresses)
Implement this method to perform the actual unbind operation. |
void |
updateTrafficControl(S session)
Controls the traffic of the specified session depending of the
IoSession.isReadSuspended() and IoSession.isWriteSuspended()
flags |
protected abstract void |
wakeup()
|
void |
write(S session,
WriteRequest writeRequest)
Writes the WriteRequest for the specified session . |
Methods inherited from class org.apache.mina.core.service.AbstractIoAcceptor |
---|
bind, bind, bind, bind, bind, getDefaultLocalAddress, getDefaultLocalAddresses, getLocalAddress, getLocalAddresses, isCloseOnDeactivation, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, toString, unbind, unbind, unbind, unbind |
Methods inherited from class org.apache.mina.core.service.AbstractIoService |
---|
addListener, broadcast, dispose, dispose, executeWorker, executeWorker, finishSessionInitialization0, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getListeners, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionConfig, getSessionDataStructureFactory, getStatistics, initSession, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.mina.core.service.IoProcessor |
---|
dispose, isDisposed, isDisposing |
Methods inherited from interface org.apache.mina.core.service.IoService |
---|
addListener, broadcast, dispose, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionConfig, getSessionDataStructureFactory, getStatistics, getTransportMetadata, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory |
Constructor Detail |
---|
protected AbstractPollingConnectionlessIoAcceptor(IoSessionConfig sessionConfig)
protected AbstractPollingConnectionlessIoAcceptor(IoSessionConfig sessionConfig, java.util.concurrent.Executor executor)
Method Detail |
---|
protected abstract void init() throws java.lang.Exception
java.lang.Exception
protected abstract void destroy() throws java.lang.Exception
java.lang.Exception
protected abstract int select() throws java.lang.Exception
java.lang.Exception
protected abstract int select(long timeout) throws java.lang.Exception
java.lang.Exception
protected abstract void wakeup()
protected abstract java.util.Set<java.nio.channels.SelectionKey> selectedHandles()
protected abstract H open(java.net.SocketAddress localAddress) throws java.lang.Exception
java.lang.Exception
protected abstract void close(H handle) throws java.lang.Exception
java.lang.Exception
protected abstract java.net.SocketAddress localAddress(H handle) throws java.lang.Exception
java.lang.Exception
protected abstract boolean isReadable(H handle)
protected abstract boolean isWritable(H handle)
protected abstract java.net.SocketAddress receive(H handle, IoBuffer buffer) throws java.lang.Exception
java.lang.Exception
protected abstract int send(S session, IoBuffer buffer, java.net.SocketAddress remoteAddress) throws java.lang.Exception
java.lang.Exception
protected abstract S newSession(IoProcessor<S> processor, H handle, java.net.SocketAddress remoteAddress) throws java.lang.Exception
java.lang.Exception
protected abstract void setInterestedInWrite(S session, boolean interested) throws java.lang.Exception
java.lang.Exception
protected void dispose0() throws java.lang.Exception
AbstractIoService.dispose()
.
dispose0
in class AbstractIoService
java.lang.Exception
protected final java.util.Set<java.net.SocketAddress> bindInternal(java.util.List<? extends java.net.SocketAddress> localAddresses) throws java.lang.Exception
bindInternal
in class AbstractIoAcceptor
Set
of the local addresses which is bound actually
java.lang.Exception
protected final void unbind0(java.util.List<? extends java.net.SocketAddress> localAddresses) throws java.lang.Exception
unbind0
in class AbstractIoAcceptor
java.lang.Exception
public final IoSession newSession(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
IoSession
that is bound to the specified
localAddress and the specified remoteAddress which
reuses the local address that is already bound by this service.
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.
newSession
in interface IoAcceptor
public final IoSessionRecycler getSessionRecycler()
public final void setSessionRecycler(IoSessionRecycler sessionRecycler)
public void add(S session)
session
to the I/O processor so that
the I/O processor starts to perform any I/O operations related
with the session
.
add
in interface IoProcessor<S extends AbstractIoSession>
session
- The added sessionpublic void flush(S session)
session
.
flush
in interface IoProcessor<S extends AbstractIoSession>
session
- The session we want the message to be writtenpublic void write(S session, WriteRequest writeRequest)
session
.
write
in interface IoProcessor<S extends AbstractIoSession>
session
- The session we want the message to be writtenwriteRequest
- the WriteRequest to writepublic void remove(S session)
session
from the I/O
processor so that the I/O processor closes the connection
associated with the session
and releases any other related
resources.
remove
in interface IoProcessor<S extends AbstractIoSession>
public void updateTrafficControl(S session)
session
depending of the
IoSession.isReadSuspended()
and IoSession.isWriteSuspended()
flags
updateTrafficControl
in interface IoProcessor<S extends AbstractIoSession>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |