Make the default thread pool create deamon threads

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@360169 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2005-12-30 21:27:21 +00:00
parent 475925394a
commit e7246d9327
1 changed files with 12 additions and 1 deletions

View File

@ -18,6 +18,7 @@ package org.apache.activemq.thread;
import edu.emory.mathcs.backport.java.util.concurrent.Executor;
import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor;
import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;
/**
*
@ -25,7 +26,17 @@ import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecuto
*/
public class DefaultThreadPools {
private static final Executor defaultPool = new ScheduledThreadPoolExecutor(5);
private static final Executor defaultPool;
static {
defaultPool = new ScheduledThreadPoolExecutor(5, new ThreadFactory() {
public Thread newThread(Runnable runnable) {
Thread thread = new Thread(runnable, "ActiveMQ Default Thread Pool Thread");
thread.setDaemon(true);
return thread;
}
});
}
private static final TaskRunnerFactory defaultTaskRunnerFactory = new TaskRunnerFactory(defaultPool,10);
public static Executor getDeaultPool() {