protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
protected void poisonAll() { int size = Math.max(config.getMaxPoolSize(), workers.size()) * 4 / 3; final Queue<Runnable> q = getQueue(); while (size-- > 0) { q.offer(poison); } }
/** * @return the current number of tasks that have been queued for processing * by this thread pool. */ @ManagedAttribute(id="thread-pool-queued-task-count") @Description("The number of tasks currently being queued by this thread pool.") public int getCurrentTaskCount() { return threadPool.getQueue().size(); }
/** * @return the current number of tasks that have been queued for processing * by this thread pool. */ @ManagedAttribute(id="thread-pool-queued-task-count") @Description("The number of tasks currently being queued by this thread pool.") public int getCurrentTaskCount() { return threadPool.getQueue().size(); }
/** * Sets the {@link ThreadPoolConfig} * @param config * @return returns {@link GrizzlyExecutorService} */ public GrizzlyExecutorService reconfigure(ThreadPoolConfig config) { synchronized (statelock) { //TODO: only create new pool if old one cant be runtime config // for the needed state change(s). final AbstractThreadPool oldpool = this.pool; if (config.getQueue() == oldpool.getQueue()) { config.setQueue(null); } setImpl(config); AbstractThreadPool.drain(oldpool.getQueue(), this.pool.getQueue()); oldpool.shutdown(); } return this; }
/** * Sets the {@link ThreadPoolConfig} * @param config * @return returns {@link GrizzlyExecutorService} */ public GrizzlyExecutorService reconfigure(ThreadPoolConfig config) { synchronized (statelock) { //TODO: only create new pool if old one cant be runtime config // for the needed state change(s). final AbstractThreadPool oldpool = this.pool; if (config.getQueue() == oldpool.getQueue()) { config.setQueue(null); } setImpl(config); AbstractThreadPool.drain(oldpool.getQueue(), this.pool.getQueue()); oldpool.shutdown(); } return this; }
/** * Sets the {@link ThreadPoolConfig} * @param config * @return returns {@link GrizzlyExecutorService} */ public GrizzlyExecutorService reconfigure(ThreadPoolConfig config) { synchronized (statelock) { //TODO: only create new pool if old one cant be runtime config // for the needed state change(s). final AbstractThreadPool oldpool = this.pool; if (config.getQueue() == oldpool.getQueue()) { config.setQueue(null); } setImpl(config); AbstractThreadPool.drain(oldpool.getQueue(), this.pool.getQueue()); oldpool.shutdown(); } return this; }
/** * Sets the {@link ThreadPoolConfig} * @param config * @return returns {@link GrizzlyExecutorService} */ public GrizzlyExecutorService reconfigure(ThreadPoolConfig config) { synchronized (statelock) { //TODO: only create new pool if old one cant be runtime config // for the needed state change(s). final AbstractThreadPool oldpool = this.pool; if (config.getQueue() == oldpool.getQueue()) { config.setQueue(null); } setImpl(config); AbstractThreadPool.drain(oldpool.getQueue(), this.pool.getQueue()); oldpool.shutdown(); } return this; }
/** * Sets the {@link ThreadPoolConfig} * @param config * @return returns {@link GrizzlyExecutorService} */ public GrizzlyExecutorService reconfigure(ThreadPoolConfig config) { synchronized (statelock) { //TODO: only create new pool if old one cant be runtime config // for the needed state change(s). final AbstractThreadPool oldpool = this.pool; if (config.getQueue() == oldpool.getQueue()) { config.setQueue(null); } setImpl(config); AbstractThreadPool.drain(oldpool.getQueue(), this.pool.getQueue()); oldpool.shutdown(); } return this; }
/** * Sets the {@link ThreadPoolConfig} * @param config * @return returns {@link GrizzlyExecutorService} */ public GrizzlyExecutorService reconfigure(ThreadPoolConfig config) { synchronized (statelock) { //TODO: only create new pool if old one cant be runtime config // for the needed state change(s). final AbstractThreadPool oldpool = this.pool; if (config.getQueue() == oldpool.getQueue()) { config.setQueue(null); } setImpl(config); AbstractThreadPool.drain(oldpool.getQueue(), this.pool.getQueue()); oldpool.shutdown(); } return this; }