|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rabbit.httpio.SelectorRunner
public class SelectorRunner
A class that handles a selector.
Constructor Summary | |
---|---|
SelectorRunner(ExecutorService executorService,
Logger logger)
Create a SelectorRunner that uses the given thread pool to run background tasks. |
Method Summary | |
---|---|
Selector |
getSelector()
Get the selector used for network operations. |
void |
run()
Run the selector operations. |
void |
runMainTask(Runnable r)
Run a task on the selector. |
void |
runThreadTask(Runnable r)
Run a task in the thread pool. |
void |
shutdown()
Stop and close the selector and shutdown the thread pool. |
void |
start()
Start running the selector in a new thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectorRunner(ExecutorService executorService, Logger logger) throws IOException
IOException
Method Detail |
---|
public void start()
public void shutdown()
shutdown
in interface TaskRunner
public void runThreadTask(Runnable r)
runThreadTask
in interface TaskRunner
r
- the task to run.public void runMainTask(Runnable r)
runMainTask
in interface TaskRunner
r
- the task to run on the main thread.public Selector getSelector()
public void run()
run
in interface Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |