Class SelectorManager
- java.lang.Object
-
- org.apache.activemq.transport.nio.SelectorManager
-
public final class SelectorManager extends Object
The SelectorManager will manage one Selector and the thread that checks the selector. We may need to consider running more than one thread to check the selector if servicing the selector takes too long.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SelectorManager.Listener
-
Field Summary
Fields Modifier and Type Field Description static SelectorManager
SINGLETON
-
Constructor Summary
Constructors Constructor Description SelectorManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExecutorService
createDefaultExecutor()
Executor
getChannelExecutor()
static SelectorManager
getInstance()
int
getMaxChannelsPerWorker()
Executor
getSelectorExecutor()
void
onWorkerEmptyEvent(SelectorWorker worker)
void
onWorkerNotFullEvent(SelectorWorker worker)
SelectorSelection
register(AbstractSelectableChannel selectableChannel, SelectorManager.Listener listener)
void
setChannelExecutor(Executor channelExecutor)
void
setMaxChannelsPerWorker(int maxChannelsPerWorker)
void
setSelectorExecutor(Executor selectorExecutor)
-
-
-
Field Detail
-
SINGLETON
public static final SelectorManager SINGLETON
-
-
Method Detail
-
createDefaultExecutor
protected ExecutorService createDefaultExecutor()
-
getInstance
public static SelectorManager getInstance()
-
register
public SelectorSelection register(AbstractSelectableChannel selectableChannel, SelectorManager.Listener listener) throws IOException
- Throws:
IOException
-
onWorkerEmptyEvent
public void onWorkerEmptyEvent(SelectorWorker worker)
-
onWorkerNotFullEvent
public void onWorkerNotFullEvent(SelectorWorker worker)
-
getChannelExecutor
public Executor getChannelExecutor()
-
setChannelExecutor
public void setChannelExecutor(Executor channelExecutor)
-
getMaxChannelsPerWorker
public int getMaxChannelsPerWorker()
-
setMaxChannelsPerWorker
public void setMaxChannelsPerWorker(int maxChannelsPerWorker)
-
getSelectorExecutor
public Executor getSelectorExecutor()
-
setSelectorExecutor
public void setSelectorExecutor(Executor selectorExecutor)
-
-