public void cancel() { cancel(false, true); }
/** * * @param listener * @param delay * @param isPersistent * @param info * @param sipApplicationSession * @return */ private ServletTimerImpl createTimerLocaly(TimerListener listener, long delay, boolean isPersistent, Serializable info, MobicentsSipApplicationSession sipApplicationSession) { ServletTimerImpl servletTimer = new ServletTimerImpl(info, delay, listener, sipApplicationSession); if(logger.isDebugEnabled()) { logger.debug("Scheduling Timer "+ servletTimer.getId() +" to expire in " + delay + " ms"); } ScheduledFuture<?> future = scheduledExecutor.schedule(servletTimer, delay, TimeUnit.MILLISECONDS); servletTimer.setFuture(future); // sipApplicationSession.timerScheduled(st); sipApplicationSession.addServletTimer(servletTimer); if (isPersistent) { persist(servletTimer); } return servletTimer; } /**
final MobicentsSipApplicationSession sipApplicationSession = getApplicationSession(); SipContext sipContext = sipApplicationSession.getSipContext(); sipContext.exitSipContext(oldClassLoader); if (isRepeatingTimer) { estimateNextExecution(); } else { cancel(); // dont bother about return value....
appSessionToCancelThisTimersFrom = getApplicationSession(); future = null;
long period, boolean fixedDelay, boolean isPersistent, Serializable info, MobicentsSipApplicationSession sipApplicationSession) { final ServletTimerImpl servletTimer = new ServletTimerImpl( info, delay, fixedDelay, period, listener, sipApplicationSession); ScheduledFuture<?> future = null; if (fixedDelay) { if(logger.isDebugEnabled()) { logger.debug("Scheduling Timer "+ servletTimer.getId() +" to expire in " + delay + " ms" + " with fixed delay of " + period); } else { if(logger.isDebugEnabled()) { logger.debug("Scheduling Timer "+ servletTimer.getId() +" to expire in " + delay + " ms" + " at fixed rate of " + period); TimeUnit.MILLISECONDS); servletTimer.setFuture(future);