public void start() { prestartAllCoreThreads(); if(logger.isInfoEnabled()) { logger.info("Started timer service "+ this); } }
/** * @param corePoolSize */ public DefaultSipApplicationSessionTimerService(int corePoolSize) { super(corePoolSize); schedulePurgeTaskIfNeeded(); }
sasTimerService = new StandardSipApplicationSessionTimerService(getApplicationName()); }else if (sasTimerServiceType != null && sasTimerServiceType == TimerServiceType.DEFAULT){ sasTimerService = new DefaultSipApplicationSessionTimerService(getApplicationName()); }else{ sasTimerService = new StandardSipApplicationSessionTimerService(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); } }
sasTimerService = new StandardSipApplicationSessionTimerService(getApplicationName()); }else if (sasTimerServiceType != null && sasTimerServiceType == TimerServiceType.DEFAULT){ sasTimerService = new DefaultSipApplicationSessionTimerService(getApplicationName()); }else{ sasTimerService = new StandardSipApplicationSessionTimerService(getApplicationName());
/** * @param corePoolSize * @param threadFactory */ public DefaultSipApplicationSessionTimerService(int corePoolSize, ThreadFactory threadFactory) { super(corePoolSize, threadFactory); schedulePurgeTaskIfNeeded(); }
/** * @param corePoolSize * @param handler */ public DefaultSipApplicationSessionTimerService(int corePoolSize, RejectedExecutionHandler handler) { super(corePoolSize, handler); schedulePurgeTaskIfNeeded(); }
/** * @param corePoolSize * @param threadFactory * @param handler */ public DefaultSipApplicationSessionTimerService(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) { super(corePoolSize, threadFactory, handler); schedulePurgeTaskIfNeeded(); }
public DefaultSipApplicationSessionTimerService(String applicationName) { super(SCHEDULER_THREAD_POOL_DEFAULT_SIZE ,new NamingThreadFactory(applicationName + "_sip_default_sas_timer_service")); schedulePurgeTaskIfNeeded(); }