@Test public void putIntoPoolNonThreadPool() { int s = SchedulerPoolFactory.POOLS.size(); SchedulerPoolFactory.tryPutIntoPool(true, null); assertEquals(s, SchedulerPoolFactory.POOLS.size()); }
static void tryPutIntoPool(boolean purgeEnabled, ScheduledExecutorService exec) { if (purgeEnabled && exec instanceof ScheduledThreadPoolExecutor) { ScheduledThreadPoolExecutor e = (ScheduledThreadPoolExecutor) exec; POOLS.put(e, exec); } }
SchedulerPoolFactory { static void tryPutIntoPool(boolean purgeEnabled, ScheduledExecutorService exec) { if (purgeEnabled && exec instanceof ScheduledThreadPoolExecutor) { ScheduledThreadPoolExecutor e = (ScheduledThreadPoolExecutor) exec; POOLS.put(e, exec); } } }
SchedulerPoolFactory { static void tryPutIntoPool(boolean purgeEnabled, ScheduledExecutorService exec) { if (purgeEnabled && exec instanceof ScheduledThreadPoolExecutor) { ScheduledThreadPoolExecutor e = (ScheduledThreadPoolExecutor) exec; POOLS.put(e, exec); } } private  SchedulerPoolFactory(); }
SchedulerPoolFactory { static void tryPutIntoPool(boolean purgeEnabled, ScheduledExecutorService exec) { if (purgeEnabled && exec instanceof ScheduledThreadPoolExecutor) { ScheduledThreadPoolExecutor e = (ScheduledThreadPoolExecutor) exec; POOLS.put(e, exec); } } private  SchedulerPoolFactory(); static void start(); static void shutdown(); static ScheduledExecutorService create(ThreadFactory factory); }
SchedulerPoolFactory { static void tryPutIntoPool(boolean purgeEnabled, ScheduledExecutorService exec) { if (purgeEnabled && exec instanceof ScheduledThreadPoolExecutor) { ScheduledThreadPoolExecutor e = (ScheduledThreadPoolExecutor) exec; POOLS.put(e, exec); } } private  SchedulerPoolFactory(); static void start(); static void shutdown(); static ScheduledExecutorService create(ThreadFactory factory); static final boolean PURGE_ENABLED; static final int PURGE_PERIOD_SECONDS; }