@Test public void testBeforeExecute() { listener.beforeExecute(null, task); verify(listener1).beforeExecute(eq(task)); verify(listener2).beforeExecute(eq(task)); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected void beforeExecute(Thread t, Runnable runnable) { for(ExecutorListener<?> listener : listeners) { try { listener.beforeExecute((HazeltaskTask)runnable); } catch(Throwable e) { log.error("An unexpected error occurred in the before Executor Listener", e); } } }
HazeltaskThreadPoolExecutor extends ThreadPoolExecutor { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected void beforeExecute(Thread t, Runnable runnable) { for(ExecutorListener<?> listener : listeners) { try { listener.beforeExecute((HazeltaskTask)runnable); } catch(Throwable e) { log.error("An unexpected error occurred in the before Executor Listener", e); } } } }
HazeltaskThreadPoolExecutor extends ThreadPoolExecutor { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected void beforeExecute(Thread t, Runnable runnable) { for(ExecutorListener<?> listener : listeners) { try { listener.beforeExecute((HazeltaskTask)runnable); } catch(Throwable e) { log.error("An unexpected error occurred in the before Executor Listener", e); } } } HazeltaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime,
            TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory,
            RejectedExecutionHandler handler); }
HazeltaskThreadPoolExecutor extends ThreadPoolExecutor { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected void beforeExecute(Thread t, Runnable runnable) { for(ExecutorListener<?> listener : listeners) { try { listener.beforeExecute((HazeltaskTask)runnable); } catch(Throwable e) { log.error("An unexpected error occurred in the before Executor Listener", e); } } } HazeltaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime,
            TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory,
            RejectedExecutionHandler handler); void addListener(ExecutorListener<?> listener); }
HazeltaskThreadPoolExecutor extends ThreadPoolExecutor { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected void beforeExecute(Thread t, Runnable runnable) { for(ExecutorListener<?> listener : listeners) { try { listener.beforeExecute((HazeltaskTask)runnable); } catch(Throwable e) { log.error("An unexpected error occurred in the before Executor Listener", e); } } } HazeltaskThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime,
            TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory,
            RejectedExecutionHandler handler); void addListener(ExecutorListener<?> listener);  }