/** * Returns the scheduled executor service used by all timed tasks in Jenkins. * * @return the single {@link ScheduledExecutorService}. */ @Nonnull public static synchronized ScheduledExecutorService get() { if (executorService == null) { // corePoolSize is set to 10, but will only be created if needed. // ScheduledThreadPoolExecutor "acts as a fixed-sized pool using corePoolSize threads" // TODO consider also wrapping in ContextResettingExecutorService executorService = new ImpersonatingScheduledExecutorService(new ErrorLoggingScheduledThreadPoolExecutor(10, new NamingThreadFactory(new ClassLoaderSanityThreadFactory(new DaemonThreadFactory()), "jenkins.util.Timer")), ACL.SYSTEM); } return executorService; }
/** * Returns the scheduled executor service used by all timed tasks in Jenkins. * * @return the single {@link ScheduledExecutorService}. */ @Nonnull public static synchronized ScheduledExecutorService get() { if (executorService == null) { // corePoolSize is set to 10, but will only be created if needed. // ScheduledThreadPoolExecutor "acts as a fixed-sized pool using corePoolSize threads" // TODO consider also wrapping in ContextResettingExecutorService executorService = new ImpersonatingScheduledExecutorService(new ErrorLoggingScheduledThreadPoolExecutor(10, new NamingThreadFactory(new DaemonThreadFactory(), "jenkins.util.Timer")), ACL.SYSTEM); } return executorService; }