Package java.util

Examples of java.util.TimerTask.cancel()


                Thread.sleep(1000);
            }
        }

        // Stop the timer, server should be up now
        timeoutTask.cancel();

        log.info("Geronimo server started");
    }

    protected String getFullClassName() {
View Full Code Here


                @SuppressWarnings("unchecked")
                final ObjectPool<Object> pool = createProxy(ObjectPool.class, calledMethods);
                final TimerTask task = PoolUtils.checkMinIdle(pool, 1, CHECK_PERIOD); // checks minIdle immediately

                Thread.sleep(CHECK_SLEEP_PERIOD); // will check CHECK_COUNT more times.
                task.cancel();
                task.toString();

                final List<String> expectedMethods = new ArrayList<String>();
                for (int i=0; i < CHECK_COUNT; i++) {
                    expectedMethods.add("getNumIdle");
View Full Code Here

                @SuppressWarnings("unchecked")
                final KeyedObjectPool<Object,Object> pool = createProxy(KeyedObjectPool.class, calledMethods);
                final TimerTask task = PoolUtils.checkMinIdle(pool, key, 1, CHECK_PERIOD); // checks minIdle immediately

                Thread.sleep(CHECK_SLEEP_PERIOD); // will check CHECK_COUNT more times.
                task.cancel();
                task.toString();

                final List<String> expectedMethods = new ArrayList<String>();
                for (int i=0; i < CHECK_COUNT; i++) {
                    expectedMethods.add("getNumIdle");
View Full Code Here

        for (Iterator iterator = ids.iterator(); iterator.hasNext();) {
            Long idLong = (Long) iterator.next();
            WorkInfo workInfo = getWorkInfo(idLong);
            if (workInfo != null) {
                TimerTask timerTask = workInfo.getExecutorFeedingTimerTask();
                timerTask.cancel();
            }
        }
    }

    void addWorkInfo(WorkInfo worker) {
View Full Code Here

        feAddrMapForRegisterReq.remove(contact);
        if (logger.isLoggable(Level.FINER)) {
                logger.finer("feAddrMapForRegisterReq : " + feAddrMapForRegisterReq);
        }
        TimerTask task = feAddrCleanupTasksMap.remove(contact);
        if(task != null && task.cancel()){
            timer.purge();
        }
    }

    private void storeFEAddrForRegisterReq(String contact, Address pathValue,
View Full Code Here

        }
        if (contact == null || pathValue == null) {
            return;
        }
        TimerTask task = feAddrCleanupTasksMap.remove(contact);
        if(task != null && task.cancel()){
            timer.purge();
        }       
        feAddrMapForRegisterReq.put(contact, pathValue);
        if (logger.isLoggable(Level.FINER)) {
                logger.finer("feAddrMapForRegisterReq : " + feAddrMapForRegisterReq);
View Full Code Here

    private void cancelAllTimerTasks() {
        try {
            int size = scheduledTimerTasks.size();
            for (int i = 0; i < size; i++) {
                TimerTask task = (TimerTask) scheduledTimerTasks.get(i);
                task.cancel();
            }
        } catch (Exception ex) {
        }  finally {
            scheduledTimerTasks.clear();
        }
View Full Code Here

    private void cancelAllTimerTasks() {
        try {
            int size = scheduledTimerTasks.size();
            for (int i = 0; i < size; i++) {
                TimerTask task = (TimerTask) scheduledTimerTasks.get(i);
                task.cancel();
            }
        } catch (Exception ex) {
        }  finally {
            scheduledTimerTasks.clear();
        }
View Full Code Here

    }
  }

  synchronized boolean endIdleAndCheckValid() {
    TimerTask tt = idle_timeout;
    if (tt != null) { tt.cancel(); }
    idle_timeout = null;
   
    if (isClosed()) {
      return false;
    } else {
View Full Code Here

       
        TimerTask task = (TimerTask) serviceToTimerTaskMap.get(service);

        // if a timer task exists, cancel it first and create a new one
        if (task != null) {
            task.cancel();
        }

        task = new TimerTask() {
            public void run() {
                if (pollInProgress) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.