Package java.util

Examples of java.util.Timer.scheduleAtFixedRate()


        Timer result=new Timer(endpoint.getTimerName(),endpoint.isDaemon());
        if(endpoint.isFixedRate()){
            if(endpoint.getTime()!=null){
                result.scheduleAtFixedRate(task,endpoint.getTime(),endpoint.getPeriod());
            }else{
                result.scheduleAtFixedRate(task,endpoint.getDelay(),endpoint.getPeriod());
            }
        }else{
            if(endpoint.getTime()!=null){
                if(endpoint.getPeriod()>=0){
                    result.schedule(task,endpoint.getTime(),endpoint.getPeriod());
View Full Code Here


        }
    }

    private void initCleaningThread(long refreshDelay) {
        Timer cleaningTimer = new Timer("RequestCounterCleaningTask", true);
        cleaningTimer.scheduleAtFixedRate(new TimerTask() {

            @Override
            public void run() {
                List<Long> toRemove = new ArrayList<Long>();
                long currentTimestamp = new Date().getTime();
View Full Code Here

      public void run() {
        update();
      }
    };
    long millis = period * 1000;
    timer.scheduleAtFixedRate(task, millis, millis);
    started = true;
  }

  protected synchronized void update() {
    for (StatUpdater c : updaters.values()) {
View Full Code Here

      throw new IllegalArgumentException("Illegal attempt to start pruner to run every " + pruneRunInMinutes + " minutes, pruneRunInMinutes must be greater than 0");
    }
    Timer timer = new Timer();
    long pruneRunInMillis = (long) (pruneRunInMinutes * 60 * 1000);
    pruner = new PruneConnectionPool(this);
    timer.scheduleAtFixedRate( pruner, pruneRunInMillis, pruneRunInMillis );
    this.pruneRunInMinutes = pruneRunInMinutes;
  }

  public void pruneOnce() {
    (new PruneConnectionPool(this)).run();
View Full Code Here

        super(parent, Resources.getString("dialog.main.title") + " v" + MapEditor.version);

        this.parent = parent;

        Timer timer = new Timer(true);
        timer.scheduleAtFixedRate(new UpdateTimerTask(), 0, 1000);

        setContentPane(createMainPanel());
        setResizable(false);
        setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        pack();
View Full Code Here

        }
      }
    };

    Timer timer = new Timer();
    timer.scheduleAtFixedRate(chartUpdaterTask, 0, 10000); // every ten seconds

  }

  public XChartPanel buildPanel() throws IOException {
View Full Code Here

        }
      }
    };

    Timer timer = new Timer();
    timer.scheduleAtFixedRate(chartUpdaterTask, 0, 10000); // every ten seconds

  }

  public XChartPanel buildPanel() throws IOException {
View Full Code Here

    {
      shareDownloadFolder();
    }

    Timer timer = new Timer("Scheduler: update folders");
    timer.scheduleAtFixedRate(this, 0, Settings.share.update_rate);
  }

  private void updateTableModel()
  {
    for (AbstractFolderTreeNode node : treeManager.getTreeRoots())
View Full Code Here

      m_currentLogLength = outFile.length();
    }
    // schedule periodical flush
    {
      final Timer timer = new Timer(true);
      timer.scheduleAtFixedRate(new TimerTask() {
        @Override
        public void run() {
          // check if closed
          if (m_output == null) {
            timer.cancel();
View Full Code Here

    } catch (PhidgetException e) {
      // TODO fix this
      e.printStackTrace();
    }
    Timer timer = new Timer();
    timer.scheduleAtFixedRate(this, 0, interval);
  }

  public CoffeeState[] get(long unixtime) {
    return unixRing.getElementsAfter(new CoffeeState(unixtime, 0));
  }
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.