List of utility methods to do Thread Executor Create
ScheduledExecutorService | getExecutorServiceWithThreadName(final String threadNamePrefix, int threadCount) get Executor Service With Thread Name return Executors.newScheduledThreadPool(threadCount, new ThreadFactory() { private int i = 1; @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r); thread.setName(threadNamePrefix + ":" + i++); return thread; }); |
long | getExecutorThreadId(final ExecutorService executor) Returns the thread ID of the background appender thread. Future<Long> result = executor.submit(new Callable<Long>() { @Override public Long call() { return Thread.currentThread().getId(); }); try { return result.get(); ... |