Runnable cleanSessionTask = new IdleSessionSweeper(sessionStore, sessionTTLinSec * 1000L);
ScheduledExecutorService idleSessionChecker = Executors.newScheduledThreadPool(1);
try {
// start idle session sweeper
idleSessionChecker.scheduleAtFixedRate(cleanSessionTask, sessionTTLinSec + 10L, sweepIntervalInSec, TimeUnit.SECONDS);
// accept connections
acceptConnections(initializer, port);
} finally {
// release threads
idleSessionChecker.shutdownNow();