public TimeScheduler3(ThreadFactory factory, int min_threads, int max_threads, long keep_alive_time, BlockingQueue<Runnable> queue, String rejection_policy, boolean thread_pool_enabled) { timer_thread_factory=factory; pool=thread_pool_enabled? new ThreadPoolExecutor(min_threads, max_threads,keep_alive_time, TimeUnit.MILLISECONDS, queue, factory, Util.parseRejectionPolicy(rejection_policy)) : new DirectExecutor(); start(); }
thread_pool=new DirectExecutor();
public TimeScheduler3(ThreadFactory factory, int min_threads, int max_threads, long keep_alive_time, BlockingQueue<Runnable> queue, String rejection_policy, boolean thread_pool_enabled) { timer_thread_factory=factory; pool=thread_pool_enabled? new ThreadPoolExecutor(min_threads, max_threads,keep_alive_time, TimeUnit.MILLISECONDS, queue, factory, Util.parseRejectionPolicy(rejection_policy)) : new DirectExecutor(); start(); }
protected void init() throws Exception { // use directExector if max thread pool size is less than or equal to zero. if(getProcessorMaxThreads() <= 0) { m_requestProcessors = new DirectExecutor(); } else { // Create worker thread pool for processing incoming buffers ThreadPoolExecutor requestProcessors = new ThreadPoolExecutor(getProcessorMinThreads(), getProcessorMaxThreads(), getProcessorKeepAliveTime(), TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(getProcessorQueueSize())); requestProcessors.setThreadFactory(new ThreadFactory() { public Thread newThread(Runnable runnable) { Thread new_thread=new Thread(thread_group, runnable); new_thread.setDaemon(true); new_thread.setName("ConnectionTableNIO.Thread"); m_backGroundThreads.add(new_thread); return new_thread; } }); m_requestProcessors = requestProcessors; } m_writeHandlers = WriteHandler.create(getWriterThreads(), thread_group, m_backGroundThreads, log); m_readHandlers = ReadHandler.create(getReaderThreads(), this, thread_group, m_backGroundThreads, log); }
oob_thread_pool=new DirectExecutor(); thread_pool=new DirectExecutor();
thread_pool=new DirectExecutor();