public abstract class Dispatcher extends Thread
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Dispatcher(String name,
Executor dcPool)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeConnectionImpl(AConnection con)
Connection will be closed [onlyClose()] and onDisconnect() method will be
executed on another thread [DisconnectionThreadPool] after
getDisconnectionDelay() time in ms.
|
SelectionKey |
register(SelectableChannel ch,
int ops,
Acceptor att)
Register new Acceptor this Dispatcher and return SelectionKey (result of
registration).
|
void |
register(SelectableChannel ch,
int ops,
AConnection att)
Register new client connected to this Dispatcher and set SelectionKey
(result of registration) as this key of given AConnection.
|
void |
run()
Dispatching Selected keys and processing pending close.
|
Selector |
selector() |
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, start, stop, stop, suspend, toString, yieldpublic Dispatcher(String name, Executor dcPool) throws IOException
name - dcPool - IOExceptionpublic final Selector selector()
public void run()
run in interface Runnablerun in class ThreadThread.run()public final void register(SelectableChannel ch, int ops, AConnection att) throws IOException
ch - ops - att - IOExceptionpublic final SelectionKey register(SelectableChannel ch, int ops, Acceptor att) throws IOException
ch - ops - att - IOExceptionprotected final void closeConnectionImpl(AConnection con)
con - Copyright © 2014–2015. All rights reserved.