taskPool = new EnhancedQueueExecutorTaskPool(new EnhancedQueueExecutor.Builder() .setCorePoolSize(builder.getCoreWorkerPoolSize()) .setMaximumPoolSize(builder.getMaxWorkerPoolSize()) .setKeepAliveTime(builder.getWorkerKeepAlive(), TimeUnit.MILLISECONDS) .setThreadFactory(new WorkerThreadFactory(builder.getThreadGroup(), builder.getWorkerStackSize(), markThreadAsDaemon))
private ExecutorService createExecutor() { final ThreadGroup group = new ThreadGroup("management-client-thread"); final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(group, Boolean.FALSE, null, "%G " + executorCount.incrementAndGet() + "-%t", null, null); } }); return EnhancedQueueExecutor.DISABLE_HINT ? new ThreadPoolExecutor(2, DEFAULT_MAX_THREADS, 60, TimeUnit.SECONDS, new LinkedBlockingDeque<>(), threadFactory) : new EnhancedQueueExecutor.Builder() .setCorePoolSize(2) .setMaximumPoolSize(DEFAULT_MAX_THREADS) .setKeepAliveTime(60, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); }
private ExecutorService createExecutor() { final ThreadGroup group = new ThreadGroup("management-client-thread"); final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(group, Boolean.FALSE, null, "%G " + executorCount.incrementAndGet() + "-%t", null, null); } }); return EnhancedQueueExecutor.DISABLE_HINT ? new ThreadPoolExecutor(2, DEFAULT_MAX_THREADS, 60, TimeUnit.SECONDS, new LinkedBlockingDeque<>(), threadFactory) : new EnhancedQueueExecutor.Builder() .setCorePoolSize(2) .setMaximumPoolSize(DEFAULT_MAX_THREADS) .setKeepAliveTime(60, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); }
executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(THREAD_POOL_CORE_SIZE) .setMaximumPoolSize(THREAD_POOL_MAX_SIZE) .setKeepAliveTime(30L, TimeUnit.MILLISECONDS) .setMaximumQueueSize(WORK_QUEUE_SIZE)
ExecutorService mgmtExecutor = new EnhancedQueueExecutor.Builder() .setCorePoolSize(512) .setMaximumPoolSize(1024) .setKeepAliveTime(20L, TimeUnit.SECONDS) .build();
ExecutorService mgmtExecutor = new EnhancedQueueExecutor.Builder() .setCorePoolSize(1) .setMaximumPoolSize(256) .setKeepAliveTime(20L, TimeUnit.SECONDS) .build();
ExecutorService mgmtExecutor = new EnhancedQueueExecutor.Builder() .setCorePoolSize(512) .setMaximumPoolSize(1024) .setKeepAliveTime(20L, TimeUnit.SECONDS) .build();
ExecutorService mgmtExecutor = new EnhancedQueueExecutor.Builder() .setCorePoolSize(1) .setMaximumPoolSize(256) .setKeepAliveTime(20L, TimeUnit.SECONDS) .build();
taskPool = new EnhancedQueueExecutorTaskPool(new EnhancedQueueExecutor.Builder() .setCorePoolSize(builder.getCoreWorkerPoolSize()) .setMaximumPoolSize(builder.getMaxWorkerPoolSize()) .setKeepAliveTime(builder.getWorkerKeepAlive(), TimeUnit.MILLISECONDS) .setThreadFactory(new WorkerThreadFactory(builder.getThreadGroup(), builder.getWorkerStackSize(), markThreadAsDaemon))
delegate = new EnhancedQueueExecutor.Builder() .setCorePoolSize(corePoolSize) .setMaximumPoolSize(maximumPoolSize) .setKeepAliveTime(keepAliveTime, unit) .setTerminationTask(new Runnable() {
/** {@inheritDoc} */ @Override public synchronized void start(StartContext context) throws StartException { MGMT_OP_LOGGER.debugf("Starting operation handler service %s", context.getController().getName()); responseAttachmentSupport = new ResponseAttachmentInputStreamSupport(scheduledExecutor.getValue()); final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(new ThreadGroup("management-handler-thread"), Boolean.FALSE, null, "%G - %t", null, null); } }); if (EnhancedQueueExecutor.DISABLE_HINT) { ThreadPoolExecutor executor = new ThreadPoolExecutor(POOL_CORE_SIZE, POOL_MAX_SIZE, 600L, TimeUnit.SECONDS, new LinkedBlockingDeque<>(WORK_QUEUE_SIZE), threadFactory); // Allow the core threads to time out as well executor.allowCoreThreadTimeOut(true); this.clientRequestExecutor = executor; } else { this.clientRequestExecutor = new EnhancedQueueExecutor.Builder() .setCorePoolSize(POOL_CORE_SIZE) .setMaximumPoolSize(POOL_MAX_SIZE) .setKeepAliveTime(600L, TimeUnit.SECONDS) .setMaximumQueueSize(WORK_QUEUE_SIZE) .setThreadFactory(threadFactory) .allowCoreThreadTimeOut(true) .build(); } }
delegate = new EnhancedQueueExecutor.Builder() .setCorePoolSize(corePoolSize) .setMaximumPoolSize(maximumPoolSize) .setKeepAliveTime(keepAliveTime, unit) .setTerminationTask(new Runnable() {
/** {@inheritDoc} */ @Override public synchronized void start(StartContext context) throws StartException { MGMT_OP_LOGGER.debugf("Starting operation handler service %s", context.getController().getName()); responseAttachmentSupport = new ResponseAttachmentInputStreamSupport(scheduledExecutor.getValue()); final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(new ThreadGroup("management-handler-thread"), Boolean.FALSE, null, "%G - %t", null, null); } }); if (EnhancedQueueExecutor.DISABLE_HINT) { ThreadPoolExecutor executor = new ThreadPoolExecutor(POOL_CORE_SIZE, POOL_MAX_SIZE, 600L, TimeUnit.SECONDS, new LinkedBlockingDeque<>(WORK_QUEUE_SIZE), threadFactory); // Allow the core threads to time out as well executor.allowCoreThreadTimeOut(true); this.clientRequestExecutor = executor; } else { this.clientRequestExecutor = new EnhancedQueueExecutor.Builder() .setCorePoolSize(POOL_CORE_SIZE) .setMaximumPoolSize(POOL_MAX_SIZE) .setKeepAliveTime(600L, TimeUnit.SECONDS) .setMaximumQueueSize(WORK_QUEUE_SIZE) .setThreadFactory(threadFactory) .allowCoreThreadTimeOut(true) .build(); } }
@Override public synchronized void start(StartContext context) throws StartException { final String namePattern = "External Management Request Threads -- %t"; final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<ThreadFactory>() { public ThreadFactory run() { return new JBossThreadFactory(threadGroup, Boolean.FALSE, null, namePattern, null, null); } }); int poolSize = getPoolSize(); if (EnhancedQueueExecutor.DISABLE_HINT) { final BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>(WORK_QUEUE_SIZE); executorService = new ThreadPoolExecutor(poolSize, poolSize, 60L, TimeUnit.SECONDS, workQueue, threadFactory); } else { executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(poolSize) .setMaximumPoolSize(poolSize) .setKeepAliveTime(60L, TimeUnit.SECONDS) .setMaximumQueueSize(WORK_QUEUE_SIZE) .setThreadFactory(threadFactory) .build(); } }
@Override public synchronized void start(StartContext context) throws StartException { final String namePattern = "External Management Request Threads -- %t"; final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<ThreadFactory>() { public ThreadFactory run() { return new JBossThreadFactory(threadGroup, Boolean.FALSE, null, namePattern, null, null); } }); int poolSize = getPoolSize(); if (EnhancedQueueExecutor.DISABLE_HINT) { final BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>(WORK_QUEUE_SIZE); executorService = new ThreadPoolExecutor(poolSize, poolSize, 60L, TimeUnit.SECONDS, workQueue, threadFactory); } else { executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(poolSize) .setMaximumPoolSize(poolSize) .setKeepAliveTime(60L, TimeUnit.SECONDS) .setMaximumQueueSize(WORK_QUEUE_SIZE) .setThreadFactory(threadFactory) .build(); } }
@Override public synchronized void start(final StartContext context) throws StartException { if (EnhancedQueueExecutor.DISABLE_HINT) { executorService = new ThreadPoolExecutor(1, Integer.MAX_VALUE, 5L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory); } else { executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(1) .setMaximumPoolSize(4096) .setKeepAliveTime(5L, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); } }
@Override public synchronized void start(final StartContext context) throws StartException { if (EnhancedQueueExecutor.DISABLE_HINT) { executorService = new ThreadPoolExecutor(1, Integer.MAX_VALUE, 5L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory); } else { executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(1) .setMaximumPoolSize(4096) .setKeepAliveTime(5L, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); } }
static ExecutorService createDefaultExecutor() { final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(defaultThreadGroup, Boolean.FALSE, null, "%G " + executorCount.incrementAndGet() + "-%t", null, null); } }); final int maxThreads = getSystemProperty("org.jboss.as.controller.client.max-threads", 6); return EnhancedQueueExecutor.DISABLE_HINT ? new ThreadPoolExecutor(2, maxThreads, 60, TimeUnit.SECONDS, new LinkedBlockingDeque<>(), threadFactory) : new EnhancedQueueExecutor.Builder() .setCorePoolSize(2) .setMaximumPoolSize(maxThreads) .setKeepAliveTime(60, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); }
@Override public synchronized void start(StartContext context) throws StartException { if (EnhancedQueueExecutor.DISABLE_HINT) { executorService = new ThreadPoolExecutor(getCorePoolSize(forDomain), Integer.MAX_VALUE, 20L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory); } else { executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(getCorePoolSize(forDomain)) .setMaximumPoolSize(1024) .setKeepAliveTime(20L, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); } }
@Override public synchronized void start(StartContext context) throws StartException { if (EnhancedQueueExecutor.DISABLE_HINT) { executorService = new ThreadPoolExecutor(getCorePoolSize(forDomain), Integer.MAX_VALUE, 20L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory); } else { executorService = new EnhancedQueueExecutor.Builder() .setCorePoolSize(getCorePoolSize(forDomain)) .setMaximumPoolSize(1024) .setKeepAliveTime(20L, TimeUnit.SECONDS) .setThreadFactory(threadFactory) .build(); } }