org.apache.activemq.transport.nio
Class SelectorManager

java.lang.Object
  extended by 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
static interface SelectorManager.Listener
           
 
Field Summary
static SelectorManager SINGLETON
           
 
Constructor Summary
SelectorManager()
           
 
Method Summary
protected  ExecutorService createDefaultExecutor()
           
 Executor getChannelExecutor()
           
static SelectorManager getInstance()
           
 int getMaxChannelsPerWorker()
           
 Executor getSelectorExecutor()
           
 void onWorkerEmptyEvent(SelectorWorker worker)
           
 void onWorkerNotFullEvent(SelectorWorker worker)
           
 SelectorSelection register(SocketChannel socketChannel, SelectorManager.Listener listener)
           
 void setChannelExecutor(Executor channelExecutor)
           
 void setMaxChannelsPerWorker(int maxChannelsPerWorker)
           
 void setSelectorExecutor(Executor selectorExecutor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

public static final SelectorManager SINGLETON
Constructor Detail

SelectorManager

public SelectorManager()
Method Detail

createDefaultExecutor

protected ExecutorService createDefaultExecutor()

getInstance

public static SelectorManager getInstance()

register

public SelectorSelection register(SocketChannel socketChannel,
                                  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)


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.