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