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 in " + watch);

        if (!background) {
            log.info("Waiting for Geronimo server to shutdown...");
View Full Code Here


      try {
        Thread.sleep(100);
      } catch (InterruptedException ignored) {
      }
    }
    failTask.cancel();
    if (fail) fail("Test did not complete in a timely manner.");
    // Give sockets a chance to close before starting the next test.
    try {
      Thread.sleep(1000);
    } catch (InterruptedException ignored) {
View Full Code Here

    }

    public synchronized void cancel(Runnable task) {
        TimerTask ticket = timerTasks.remove(task);
        if (ticket != null) {
            ticket.cancel();
            timer.purge(); // remove cancelled TimerTasks
        }
    }

    public synchronized void executeAfterDelay(final Runnable task, long redeliveryDelay) {
View Full Code Here

                    t.onEvent(Mailbox.this, timedOut);
                }
            };
            Task.timer.schedule(tt, timeoutMillis);
            Task.pause(this);
            tt.cancel();
            removeMsgAvailableListener(t);
            msg = get(t);
           
            timeoutMillis = end - System.currentTimeMillis();
            if (timeoutMillis <= 0) {
View Full Code Here

                  t.onEvent(Mailbox.this, timedOut);
        }
      };
      Task.timer.schedule(tt, timeoutMillis);
      Task.pause(this);
      tt.cancel();
      has_msg = hasMessage(t);
      timeoutMillis = end - System.currentTimeMillis();
      if (timeoutMillis <= 0) {
              removeMsgAvailableListener(t);
        break;
View Full Code Here

                  t.onEvent(Mailbox.this, timedOut);
        }
      };
      Task.timer.schedule(tt, timeoutMillis);
      Task.pause(this);
      if (!tt.cancel()) {
              removeMsgAvailableListener(t);
      }

      has_msg = hasMessages(num, t);
      timeoutMillis = end - System.currentTimeMillis();
View Full Code Here

                        t.onEvent(Cell.this, timedOut);
                    }
                };
            Task.timer.schedule(tt, timeoutMillis);
            Task.pause(this);
            tt.cancel();
            if (System.currentTimeMillis() - begin > timeoutMillis) {
                break;
            }
            removeMsgAvailableListener(t);
            msg = get(t);
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

            // by the "active" boolean flag
            TimerTask task = statusTaskMap.remove(identity);
            if (task != null) {
                // if there was a timer task pending, then we've just negated
                // it with the new status, so cancel the task
                task.cancel();
            } else {
                // there was no pending task, so set one up
                task = new StatusChangeTask(identity, active);
                statusTaskMap.put(identity, task);
                statusUpdateTimer.schedule(task, voteDelay);
View Full Code Here

     */
    public static void cancel(MonitorAction action)
    {
        TimerTask task = __tasks.remove(action.getID());
        if (task != null)
            task.cancel();
    }

    /* ------------------------------------------------------------ */
    /**
     * This method is invoked when poll interval has elapsed
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.