ExecutableQueue implements IDestroyable { public ExecutableQueue() { this(null, 0, 0, 0, 0, 0, 0, null); } ExecutableQueue();  ExecutableQueue(String prefix);  ExecutableQueue(RejectedExecutionHandler rejectedExecutionHandler);  ExecutableQueue(int concurrentCount, RejectedExecutionHandler rejectedExecutionHandler);  ExecutableQueue(String prefix, int concurrentCount, RejectedExecutionHandler rejectedExecutionHandler);  ExecutableQueue(String prefix, int minPoolSize, int maxPoolSize, int workQueueSize, long queueTimeout, int queueSize, int concurrentCount, RejectedExecutionHandler rejectedExecutionHandler); synchronized void listenStart(); void listenStop(); final synchronized void listenStop(long millis); @Override void destroy(); boolean checkStatus(); void addListener(IListener<E> listener); void addListener(String id, IListener<E> listener); IListener<E> removeListener(Class<? extends IListener> listener); IListener<E> removeListener(String id); Map<String, IListener<E>> removeAllListeners(); void putElement(E element); void putElements(Collection<E> elements); int getQueueSize(); int getWorkQueueSize(); E execute(Callable<E> worker); E execute(Callable<E> worker, long timeout); void execute(List<Callable<E>> workers);  }
@Test public void executableQueue() { ExecutableQueue<String> _queue = new ExecutableQueue<String>("MyQueue"); _queue.addListener(new ExecutableQueue.IListener<String>() { @Override public List<ExecutableQueue.IFilter<String>> getFilters() { ExecutableQueue.IFilter<String> _filter = new ExecutableQueue.IFilter<String>() { @Override public boolean filter(String element) { return StringUtils.containsIgnoreCase(element, "filter"); } }; return Collections.singletonList(_filter); } @Override public void listen(String element) { System.out.println("Listen: " + element); } }); _queue.listenStart(); _queue.putElement("Hi."); _queue.putElement("This element will be filtered."); _queue.putElement("ExecutableQueue."); _queue.destroy(); }