public class DefaultExecutorFactory implements ExecutorFactory {
private final AtomicInteger counter = new AtomicInteger(0);
@Override
public ExecutorService getExecutor(Properties p) {
TypedProperties tp = TypedProperties.toTypedProperties(p);
int maxThreads = tp.getIntProperty("maxThreads", 1);
int queueSize = tp.getIntProperty("queueSize", 100000);
int coreThreads = queueSize == 0 ? 1 : tp.getIntProperty("coreThreads", maxThreads);
long keepAliveTime = tp.getLongProperty("keepAliveTime", 60000);
final int threadPrio = tp.getIntProperty("threadPriority", Thread.MIN_PRIORITY);
final String threadNamePrefix = tp.getProperty("threadNamePrefix", tp.getProperty("componentName", "Thread"));
final String threadNameSuffix = tp.getProperty("threadNameSuffix", "");
BlockingQueue<Runnable> queue = queueSize == 0 ? new SynchronousQueue<Runnable>() :
new LinkedBlockingQueue<Runnable>(queueSize);
ThreadFactory tf = new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {