Package java.util

Examples of java.util.TimerTask


    public void cancelTimerTasks(Collection ids) {
        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();
            }
        }
    }
View Full Code Here


    */
    synchronized void scheduleTimeoutTask(long timeoutMillis) {
        // schedule a time out task if the timeout was specified
        if (timeoutMillis > 0) {
            // take care of the transaction timeout
            TimerTask cancelTask = new CancelXATransactionTask();
            TimerFactory timerFactory = Monitor.getMonitor().getTimerFactory();
            Timer timer = timerFactory.getCancellationTimer();
            timer.schedule(cancelTask, timeoutMillis);
        } else {
            timeoutTask = null;
View Full Code Here

      
       if(waitForIt) {
           log.info("Waiting for destroyed process {} to exit (timeout={} seconds)", processInfo, timeoutSeconds);
           final Thread mainThread = Thread.currentThread();
           final Timer t = new Timer(true);
           final TimerTask task = new TimerTask() {
                @Override
                public void run() {
                    mainThread.interrupt();
                }
           };
View Full Code Here

    modelWatcher.setModelHandler(modelHandler);

    // schedule a retry every thirty seconds in case we can't reset the
    // watch
    timer = new Timer();
    timer.scheduleAtFixedRate(new TimerTask() {
      @Override
      public void run() {
        modelWatcher.process(null);
      }
    }, 0, 3000);
View Full Code Here

          if (!curText.equals(lastText)) {
            if (timer != null) {
              timer.cancel();
            }
            timer = new Timer();
            timer.schedule(new TimerTask() {
              @Override
              public void run() {
                composite.getDisplay().syncExec(task);
              }
            }, timerDelay);
View Full Code Here

        
       if(mColorTimer != null)
         mColorTimer.cancel();
      
         //create the task for a timer tick
         TimerTask task = new TimerTask()
         {
             public void run()
             {
               initColors();
               repaint();
View Full Code Here

            timeoutTask = null;
        }

        if (deadLine > System.currentTimeMillis())
        {
            timeoutTask = new TimerTask()
            {
                @Override
                public void run()
                {
                    CoordinationImpl.this.timeout();
View Full Code Here

        return (TimerEndpoint) super.getEndpoint();
    }

    @Override
    protected void doStart() throws Exception {
        task = new TimerTask() {
            // counter
            private final AtomicLong counter = new AtomicLong();

            @Override
            public void run() {
View Full Code Here

        final AtomicBoolean hasTimedOut = new AtomicBoolean(false);
        Timer timer = null;
        try {
            if (timeoutMs < Long.MAX_VALUE) {
                timer = new Timer(true);
                timer.schedule(new TimerTask() {

                    @Override
                    public void run() {
                        hasTimedOut.set(true);
                    }
View Full Code Here

                    public void buttonClick(ClickEvent event) {
                        counter2.setValue(0);
                        if (task != null) {
                            task.cancel();
                        }
                        task = new TimerTask() {

                            @Override
                            public void run() {
                                access(new Runnable() {
                                    @Override
View Full Code Here

TOP

Related Classes of java.util.TimerTask

Copyright © 2018 www.massapicom. 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.