/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { synchronized (stateLock) { List<Runnable> drained = new ArrayList<Runnable>(); if (running) { running = false; drain(getQueue(), drained); for (Runnable task : drained) { onTaskDequeued(task); onTaskCancelled(task); } poisonAll(); //try to interrupt their current work so they can get their poison fast for (Worker w : workers.keySet()) { w.t.interrupt(); } ProbeNotifier.notifyThreadPoolStopped(this); } return drained; } }
/** * 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; }
/** * 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; }