public static Executor createJBossThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, List<Object> taskFilterObjects) { return JBossExecutors.wrappingExecutor(createTaskFilter(taskFilterObjects), new JBossThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory)); }
public synchronized void start(final StartContext context) throws StartException { final TimeSpec keepAliveSpec = keepAlive; long keepAliveTime = keepAliveSpec == null ? Long.MAX_VALUE : keepAliveSpec.getUnit().toNanos(keepAliveSpec.getDuration()); final JBossThreadPoolExecutor jbossExecutor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAliveTime, TimeUnit.NANOSECONDS, new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue()); jbossExecutor.setAllowCoreThreadTimeout(allowCoreThreadTimeout); executor = new ManagedJBossThreadPoolExecutorService(jbossExecutor); }