From e7246d9327a00838875a9aa387d28e94a49aaf83 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Fri, 30 Dec 2005 21:27:21 +0000 Subject: [PATCH] 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 --- .../apache/activemq/thread/DefaultThreadPools.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java b/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java index bc11ac200c..64ec1eabe0 100755 --- a/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java +++ b/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java @@ -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() {