public class Dispatcher extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
started |
| Constructor and Description |
|---|
Dispatcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncRun(Runnable task) |
void |
close() |
Dispatcher |
executorCount(int count) |
ExecutorService |
executorService() |
SelectorThread |
getSelector(int index) |
SelectorThread |
getSelector(SelectionKey key) |
boolean |
isStarted() |
Dispatcher |
name(String name) |
SelectorThread |
nextSelector() |
void |
registerChannel(SelectableChannel channel,
int ops) |
Session |
registerClientChannel(String host,
int port,
IoAdaptor ioAdaptor) |
ServerSocketChannel |
registerServerChannel(String host,
int port) |
void |
registerSession(int ops,
Session sess) |
int |
selectorCount() |
Dispatcher |
selectorCount(int count) |
IoAdaptor |
serverIoAdaptor() |
Dispatcher |
serverIoAdaptor(IoAdaptor serverIoAdaptor) |
void |
start() |
void |
stop() |
public SelectorThread getSelector(int index)
public SelectorThread nextSelector()
public void registerChannel(SelectableChannel channel, int ops) throws IOException
IOExceptionpublic void registerSession(int ops,
Session sess)
throws IOException
IOExceptionpublic SelectorThread getSelector(SelectionKey key)
public void start()
public void stop()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean isStarted()
public IoAdaptor serverIoAdaptor()
public Dispatcher serverIoAdaptor(IoAdaptor serverIoAdaptor)
public ExecutorService executorService()
public void asyncRun(Runnable task)
public int selectorCount()
public Dispatcher selectorCount(int count)
public Dispatcher executorCount(int count)
public Dispatcher name(String name)
public ServerSocketChannel registerServerChannel(String host, int port) throws IOException
IOExceptionpublic Session registerClientChannel(String host, int port, IoAdaptor ioAdaptor) throws IOException
IOExceptionCopyright © 2015. All rights reserved.