public static ScheduledExecutorService newScheduledThreadPool(int poolSize, long keepAliveTime,
      TimeUnit unit, String threadName, ThreadsMonitoring threadsMonitoring) {
    ThreadFactory threadFactory = new LoggingThreadFactory(threadName);
    ScheduledThreadPoolExecutorWithKeepAlive result =
        new ScheduledThreadPoolExecutorWithKeepAlive(poolSize, keepAliveTime, unit, threadFactory,
            threadsMonitoring);
    result.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
    result.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
    return result;
  }
Utility class that creates instances of ExecutorService whose threads will always log uncaught
exceptions.
geode-core/src/main/java/org/apache/geode/internal/logging/CoreLoggingExecutors.java