@Override protected void doStop() throws Exception { super.doStop(); if (START_COUNTER.decrementAndGet() == 0) { synchronized (QUEUES) { for (BlockingQueue<Exchange> q : QUEUES.values()) { q.clear(); } QUEUES.clear(); } } }
@Override protected void doStart() throws Exception { super.doStart(); START_COUNTER.incrementAndGet(); }