private void startExecutor() {
        if (executor == null || executor.isShutdown()) {
            // keep the amount of workers low! See comment that goes with the
            // field named 'executor'.
            Log.debug("Starting executor service...");
            executor = new ThreadPoolExecutor(
                EXECUTOR_CORE_POOL_SIZE.getValue(),
                EXECUTOR_MAX_POOL_SIZE.getValue(),
                EXECUTOR_POOL_KEEP_ALIVE.getValue().toSeconds(),
                TimeUnit.SECONDS,
                new SynchronousQueue<>(),
                new NamedThreadFactory( "pep-worker-", null, null, null ) );

            executor = (ThreadPoolExecutor) Executors.newScheduledThreadPool(2, new NamedThreadFactory( "pep-worker-", null, null, null ) );

            if (JMXManager.isEnabled()) {
                final ThreadPoolExecutorDelegateMBean mBean = new ThreadPoolExecutorDelegate(executor);
                objectName = JMXManager.tryRegister(mBean, ThreadPoolExecutorDelegateMBean.BASE_OBJECT_NAME + "pep");
            }
        }
    }
Starts a new thread pool, unless an existing one is still running.
xmppserver/src/main/java/org/jivesoftware/openfire/pep/IQPEPHandler.java