1 18 package org.apache.activemq.thread; 19 20 import java.util.concurrent.Executor ; 21 import java.util.concurrent.ScheduledThreadPoolExecutor ; 22 import java.util.concurrent.ThreadFactory ; 23 24 28 public class DefaultThreadPools { 29 30 private static final Executor defaultPool; 31 static { 32 defaultPool = new ScheduledThreadPoolExecutor (5, new ThreadFactory () { 33 public Thread newThread(Runnable runnable) { 34 Thread thread = new Thread (runnable, "ActiveMQ Default Thread Pool Thread"); 35 thread.setDaemon(true); 36 return thread; 37 } 38 }); 39 } 40 41 private static final TaskRunnerFactory defaultTaskRunnerFactory = new TaskRunnerFactory(); 42 43 public static Executor getDefaultPool() { 44 return defaultPool; 45 } 46 47 public static TaskRunnerFactory getDefaultTaskRunnerFactory() { 48 return defaultTaskRunnerFactory; 49 } 50 51 } 52 | Popular Tags |