@Override public void purgeTimerTasks() { Timer timer = cancelTimer; if (timer != null) { timer.purge(); } }
protected void stopRedrawTimer() { if ( redrawTimer != null ) { redrawTimer.cancel(); redrawTimer.purge(); redrawTimer = null; } }
public void stop() { timer.cancel(); timer.purge(); }
@Override public void stop() { timer.cancel(); timer.purge(); } }
public synchronized void cancel(Runnable task) { TimerTask ticket = timerTasks.remove(task); if (ticket != null) { ticket.cancel(); timer.purge(); // remove cancelled TimerTasks } }
public static synchronized void cancel(Runnable task) { TimerTask ticket = TIMER_TASKS.remove(task); if (ticket != null) { ticket.cancel(); CLOCK_DAEMON.purge();//remove cancelled TimerTasks } }
@Override public void run() { DecayRpcScheduler sched = schedulerRef.get(); if (sched != null) { sched.decayCurrentCounts(); } else { // Our scheduler was garbage collected since it is no longer in use, // so we should terminate the timer as well timer.cancel(); timer.purge(); } } }
@Override protected void finalize() throws Throwable { try { if(_cleaner!=null) { _cleaner.interrupt(); } if(this.timer!=null) { this.task.cancel(); this.timer.purge(); } } finally { super.finalize(); } }
public int timerPurge() { if (logger.isTraceEnabled()) { logger.trace("SystemTimer#timerPurge of {}", this); } // Fix 39585, IBM's java.util.timer's purge() has stack overflow issue if (isIBM) { return 0; } return this.timer.purge(); }
public synchronized void stopConnectCheckTask() { if (connectCheckerTask != null) { LOG.trace("Stopping connection check task for: {}", this); connectCheckerTask.cancel(); connectCheckerTask = null; synchronized (AbstractInactivityMonitor.class) { READ_CHECK_TIMER.purge(); CHECKER_COUNTER--; } } }
/** * Stops the background sorting without deleting clearing this container. * This is required for proper clean-up. * <br><br> * Note that if a sorting process is running while this method is called, * the sorting process finishes sorting this method will wait for it to * finish. Afterwards the sorting is not scheduled again until the * initialize method is called again. * <br><br> * Note that calling stop() and clear() can be done in any order and the * specified behaviour will be exactly the same. If there is a difference it * is an insignificant performance loss or win if. */ public synchronized void stop() { if (timer != null) { //stopping a paused instance timer.cancel(); timer.purge(); timer = null; } if (sortingThread != null) { try { sortingThread.join(); } catch (InterruptedException ex) { logger.error("Joining of sorting thread was interrupted!"); } } sortingThread = null; sortingTask = null; }
@Signature public static void cancelAll() { timer().cancel(); timer().purge(); timer = new Timer("php\\time\\Timer"); }
@Signature public static void shutdownAll() { timer().cancel(); timer().purge(); } }
protected synchronized void stopMonitorThreads() { stopConnectCheckTask(); if (monitorStarted.compareAndSet(true, false)) { if (readCheckerTask != null) { readCheckerTask.cancel(); } if (writeCheckerTask != null) { writeCheckerTask.cancel(); } synchronized (AbstractInactivityMonitor.class) { WRITE_CHECK_TIMER.purge(); READ_CHECK_TIMER.purge(); CHECKER_COUNTER--; if (CHECKER_COUNTER == 0) { WRITE_CHECK_TIMER.cancel(); READ_CHECK_TIMER.cancel(); WRITE_CHECK_TIMER = null; READ_CHECK_TIMER = null; try { ThreadPoolUtils.shutdownGraceful(ASYNC_TASKS, TimeUnit.SECONDS.toMillis(10)); } finally { ASYNC_TASKS = null; } } } } }
private Timer mTimer1; private TimerTask mTt1; private Handler mTimerHandler = new Handler(); private void stopTimer(){ if(mTimer1 != null){ mTimer1.cancel(); mTimer1.purge(); } } private void startTimer(){ mTimer1 = new Timer(); mTt1 = new TimerTask() { public void run() { mTimerHandler.post(new Runnable() { public void run(){ //TODO } }); } }; mTimer1.schedule(mTt1, 1, 5000); }
timer.purge(); timer = null;
@Override public synchronized void stop(final StopContext context) { // un-register ourselves to the TimerServiceRegistry (if any) if (timerServiceRegistry != null) { timerServiceRegistry.unRegisterTimerService(this); } timerPersistence.getValue().timerUndeployed(timedObjectInvoker.getValue().getTimedObjectId()); started = false; IoUtils.safeClose(listenerHandle); listenerHandle = null; timerInjectedValue.getValue().purge(); //WFLY-3823 }
private synchronized void scheduleServicesRestartTask() { if (certTimer != null) { certTimer.cancel(); certTimer.purge(); } certTimer = new Timer("Certificate Renewal Timer"); certTimer.schedule(new PostCertificateRenewalTask(this), 5000L); }