|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.nio.MultiSelectorNioHandler
public class MultiSelectorNioHandler
An implementation of NioHandler that runs several selector threads.
| Constructor Summary | |
|---|---|
MultiSelectorNioHandler(ExecutorService executorService,
int numSelectors)
Create a new MultiSelectorNioHandler that runs background tasks on the given executor and has a specified number of selectors. |
|
| Method Summary | |
|---|---|
void |
cancel(SelectableChannel channel,
SocketChannelHandler handler)
Remove an event listener. |
void |
close(SelectableChannel channel)
Close the given channel. |
Long |
getDefaultTimeout()
Get the default timeout time for an operations started at this point in time. |
StatisticsHolder |
getTimingStatistics()
Get the timing information for the thread tasks. |
void |
runThreadTask(Runnable r,
TaskIdentifier ti)
Run a task in a background thread. |
void |
shutdown()
Shutdown this task runner. |
void |
start()
Start handling operations. |
void |
visitSelectors(SelectorVisitor visitor)
Visit all the selectors. |
void |
waitForAccept(SelectableChannel channel,
AcceptHandler handler)
Install an event listener for accent events. |
void |
waitForConnect(SelectableChannel channel,
ConnectHandler handler)
Install an event listener for connect events. |
void |
waitForRead(SelectableChannel channel,
ReadHandler handler)
Install an event listener for read events. |
void |
waitForWrite(SelectableChannel channel,
WriteHandler handler)
Install an event listener for write events. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiSelectorNioHandler(ExecutorService executorService,
int numSelectors)
throws IOException
IOException| Method Detail |
|---|
public void start()
NioHandler
start in interface NioHandlerpublic void shutdown()
NioHandler
shutdown in interface NioHandlerpublic Long getDefaultTimeout()
NioHandler
getDefaultTimeout in interface NioHandler
public void runThreadTask(Runnable r,
TaskIdentifier ti)
NioHandler
runThreadTask in interface NioHandlerr - the task to run.
public void waitForRead(SelectableChannel channel,
ReadHandler handler)
NioHandler
waitForRead in interface NioHandler
public void waitForWrite(SelectableChannel channel,
WriteHandler handler)
NioHandler
waitForWrite in interface NioHandler
public void waitForAccept(SelectableChannel channel,
AcceptHandler handler)
NioHandler
waitForAccept in interface NioHandler
public void waitForConnect(SelectableChannel channel,
ConnectHandler handler)
NioHandler
waitForConnect in interface NioHandler
public void cancel(SelectableChannel channel,
SocketChannelHandler handler)
NioHandler
cancel in interface NioHandlerpublic void close(SelectableChannel channel)
NioHandler
close in interface NioHandlerpublic void visitSelectors(SelectorVisitor visitor)
NioHandler
visitSelectors in interface NioHandlerpublic StatisticsHolder getTimingStatistics()
NioHandler
getTimingStatistics in interface NioHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||