public class NioManagerDispatchThread extends NioManagerThread
NioManagerThread
that dispatches newly created connections to NioManagerIoThread
s.Modifier and Type | Class and Description |
---|---|
protected class |
NioManagerDispatchThread.AcceptRegistry
A bookkeeping class for storing pending accepts on listening sockets.
|
NioManagerThread.NioManagerThreadStatus, NioManagerThread.Request<I,O>
Thread.State, Thread.UncaughtExceptionHandler
exception, fsm, fsmInternal, log, queue, requests, selector, status
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier | Constructor and Description |
---|---|
protected |
NioManagerDispatchThread(String name,
int nThreads)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
dispatch(NioConnection conn)
Dispatches the given connection to an
NioManagerIoThread . |
protected void |
doAccept(SelectionKey key)
Finishes the accept cycle on a ready
ServerSocketChannel . |
protected void |
doConnect(NioConnection conn)
Finishes the connect cycle on a ready connection.
|
protected void |
doReadyOps(int readyOps,
SelectionKey key)
Performs actions stipulated by a ready operations bit vector on the given
SelectionKey . |
protected void |
handleAccept(NioConnection conn,
InetSocketAddress address)
Handles a connection accept request.
|
protected void |
handleConnect(NioConnection conn,
InetSocketAddress address)
Handles a connection connect request.
|
protected void |
handleGetBacklogSize(NioManagerThread.Request<?,Integer> request)
Handles a request to get the listen backlog size.
|
protected void |
handleGetBoundAddresses(NioManagerThread.Request<?,List<InetSocketAddress>> request)
Handles a request to get the list of bound addresses.
|
protected void |
handleGetConnections(NioManagerThread.Request<?,List<Future<List<NioConnection>>>> request)
Handles a request to get the list of connections, which consists of pending connections aggregated with the lists
reported by helper
NioManagerIoThread s. |
protected void |
handleRegister(NioConnection conn,
SocketChannel chan)
Handles a connection registration request.
|
protected void |
handleSetBacklogSize(NioManagerThread.Request<Integer,?> request)
Handles a request to set the listen backlog size.
|
protected void |
onStart()
On thread start.
|
protected void |
onStop()
On thread stop.
|
protected void |
purge(NioConnection conn)
A sequence of actions to take when deleting a connection, as far as this thread is concerned.
|
void |
start()
Starts this thread and its helper
NioManagerIoThread s. |
close, debug, debug, getStatus, handleClose, handleClosingEos, handleClosingUser, handleError, handleInvoke, handleOp, handleShutdown, initFsms, onLocal, request, run, setStatus, toString
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, yield
protected NioManagerDispatchThread(String name, int nThreads)
protected void onStart()
NioManagerThread
onStart
in class NioManagerThread
protected void onStop()
NioManagerThread
onStop
in class NioManagerThread
protected void doReadyOps(int readyOps, SelectionKey key)
NioManagerThread
SelectionKey
.doReadyOps
in class NioManagerThread
protected void purge(NioConnection conn)
NioManagerThread
purge
in class NioManagerThread
public void start()
NioManagerIoThread
s.protected void dispatch(NioConnection conn)
NioManagerIoThread
.protected void doAccept(SelectionKey key)
ServerSocketChannel
.protected void doConnect(NioConnection conn)
protected void handleConnect(NioConnection conn, InetSocketAddress address)
protected void handleAccept(NioConnection conn, InetSocketAddress address)
protected void handleRegister(NioConnection conn, SocketChannel chan)
protected void handleGetBoundAddresses(NioManagerThread.Request<?,List<InetSocketAddress>> request)
protected void handleGetConnections(NioManagerThread.Request<?,List<Future<List<NioConnection>>>> request)
NioManagerIoThread
s.protected void handleGetBacklogSize(NioManagerThread.Request<?,Integer> request)
protected void handleSetBacklogSize(NioManagerThread.Request<Integer,?> request)