Here you can find the source of getScheduler()
static ScheduledThreadPoolExecutor getScheduler()
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ScheduledThreadPoolExecutor; public class Main { /**/*from ww w . jav a2s. com*/ * Lock used to coordinate and synchronize all JPAZ related atomic actions */ private static final Object jpazLock = new Object(); /** * ScheduledThreadPoolExecutor used to schedule and execute timer ticks. */ private static ScheduledThreadPoolExecutor tickExecutor = null; /** * Returns scheduled thread-pool executor used for scheduling and execution * of timer ticks. * * @return the common ScheduledThreadPoolExecutor object for scheduling * timer ticks. */ static ScheduledThreadPoolExecutor getScheduler() { synchronized (getJPAZLock()) { if (tickExecutor == null) { tickExecutor = new ScheduledThreadPoolExecutor(1); } return tickExecutor; } } /** * Returns the object used as synchronization lock for all JPAZ objects. In * order to avoid deadlock and achieving mutual exclusion, all JPAZ objects * use the only shared lock. This object should be used as a lock for each * JPAZ atomic action. * * @return synchronization the lock object. */ public static synchronized Object getJPAZLock() { return jpazLock; } }