I create the following executor in a singleton:
final private ExecutorService executor = Executors.newSingleThreadExecutor(new ThreadFactory() {
Maybe you should use a thread pool instead of using a single executor.
executor = new java.util.concurrent.ThreadPoolExecutor(30, 30, 60, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
final AtomicInteger threadNumber = new AtomicInteger( 1 );
@Override
public Thread newThread(Runnable r) {
return new Thread(r, "Thread No : " + threadNumber.getAndIncrement());
}
});