Give the user more rope.
This commit is contained in:
Timothy Bish 2014-12-10 16:51:47 -05:00
parent 994d9b26a0
commit 1409acb36e
1 changed files with 9 additions and 1 deletions

View File

@ -43,7 +43,7 @@ public final class SelectorManager {
private int maxChannelsPerWorker = 1024; private int maxChannelsPerWorker = 1024;
protected ExecutorService createDefaultExecutor() { protected ExecutorService createDefaultExecutor() {
ThreadPoolExecutor rc = new ThreadPoolExecutor(0, Integer.MAX_VALUE, getDefaultKeepAliveTime(), TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), ThreadPoolExecutor rc = new ThreadPoolExecutor(getDefaultCorePoolSize(), getDefaultMaximumPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new SynchronousQueue<Runnable>(),
new ThreadFactory() { new ThreadFactory() {
private long i = 0; private long i = 0;
@ -59,6 +59,14 @@ public final class SelectorManager {
return rc; return rc;
} }
private static int getDefaultCorePoolSize() {
return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.corePoolSize", 0);
}
private static int getDefaultMaximumPoolSize() {
return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.maximumPoolSize", Integer.MAX_VALUE);
}
private static int getDefaultKeepAliveTime() { private static int getDefaultKeepAliveTime() {
return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.keepAliveTime", 30); return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.keepAliveTime", 30);
} }