public void start() { prestartAllCoreThreads(); if(logger.isInfoEnabled()) { logger.info("Started timer service "+ this); } } }
/** * @param corePoolSize * @param handler */ public DefaultProxyTimerService(int corePoolSize, RejectedExecutionHandler handler) { super(corePoolSize, handler); schedulePurgeTaskIfNeeded(); }
proxyTimerService = new ProxyTimerServiceImpl(getApplicationName()); } else if(proxyTimerServiceType != null && proxyTimerServiceType == TimerServiceType.DEFAULT) { proxyTimerService = new DefaultProxyTimerService(getApplicationName()); } else { proxyTimerService = new ProxyTimerServiceImpl(getApplicationName());
public void run() { try { if(logger.isDebugEnabled()) { logger.debug("Purging canceled timer tasks..."); } purge(); if(logger.isDebugEnabled()) { logger.debug("Purging canceled timer tasks completed."); } } catch (Exception e) { logger.error("failed to execute purge",e); } } };
private void schedulePurgeTaskIfNeeded() { int purgePeriod = StaticServiceHolder.sipStandardService.getCanceledTimerTasksPurgePeriod(); if(purgePeriod > 0) { Runnable r = new Runnable() { public void run() { try { if(logger.isDebugEnabled()) { logger.debug("Purging canceled timer tasks..."); } purge(); if(logger.isDebugEnabled()) { logger.debug("Purging canceled timer tasks completed."); } } catch (Exception e) { logger.error("failed to execute purge",e); } } }; scheduleWithFixedDelay(r, purgePeriod, purgePeriod, TimeUnit.MINUTES); } }
proxyTimerService = new ProxyTimerServiceImpl(getApplicationName()); } else if(proxyTimerServiceType != null && proxyTimerServiceType == TimerServiceType.DEFAULT) { proxyTimerService = new DefaultProxyTimerService(getApplicationName()); } else { proxyTimerService = new ProxyTimerServiceImpl(getApplicationName());
/** * @param corePoolSize * @param threadFactory */ public DefaultProxyTimerService(int corePoolSize, ThreadFactory threadFactory) { super(corePoolSize, threadFactory); schedulePurgeTaskIfNeeded(); }
/** * @param corePoolSize * @param threadFactory * @param handler */ public DefaultProxyTimerService(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) { super(corePoolSize, threadFactory, handler); schedulePurgeTaskIfNeeded(); }
public DefaultProxyTimerService(int corePoolSize) { super(corePoolSize); schedulePurgeTaskIfNeeded(); }
public DefaultProxyTimerService(String applicationName, int corePoolSize) { super(corePoolSize, new NamingThreadFactory(applicationName + "_sip_default_proxy_timer_service")); schedulePurgeTaskIfNeeded(); }
public DefaultProxyTimerService(String applicationName) { super(SCHEDULER_THREAD_POOL_DEFAULT_SIZE, new NamingThreadFactory(applicationName + "_sip_default_proxy_timer_service")); schedulePurgeTaskIfNeeded(); }