Package java.util

Examples of java.util.Timer.scheduleAtFixedRate()


   public void startTimer()
   {
      Timer t = new Timer();
      Send10Notifies task = new Send10Notifies();
      t.scheduleAtFixedRate(task, 0, 1000);
   }

   /**
    * @jmx:managed-attribute
    */
 
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(WindowConstants.HIDE_ON_CLOSE);
    pack();
View Full Code Here

        Calendar cal = Calendar.getInstance();
        cal.set(2004, Calendar.NOVEMBER, 31);
        t.schedule(new HelloWorldTask(), cal.getTime());

        t.scheduleAtFixedRate(new HelloWorldTask(), cal.getTime(),
                MILLIS_IN_YEAR);
    }
}
View Full Code Here

*/
public class FixedRateScheduling {

    public static void main(String[] args) throws Exception {
        Timer t = new Timer();
        t.scheduleAtFixedRate(new HelloWorldTask(), 1000, 1000);       
    }
}
View Full Code Here

            this.b_addCrossroad.setEnabled(false);
            this.b_del.setEnabled(false);
            this.b_mapImport.setEnabled(false);
            this.b_mapExport.setEnabled(false);
            Timer Sim = new Timer();
            Sim.scheduleAtFixedRate(Instance, (long) 0.0000000001, Instance.timeSlice);
            Instance.started = true;
            Instance.running = true;
        }
        else Instance.pause = false;
    }
View Full Code Here

            Timer timer =
                ContainerFactoryImpl.getContainerService().getTimer();
            if (RELATIVE_TIME_CHECK_MODE) {
                refreshTask = new CurrentTimeRefreshTask ();
                timer.scheduleAtFixedRate(refreshTask, timerFrequency*1000, timerFrequency*1000);
            } else {
                refreshTask = new RefreshTask();
                timer.scheduleAtFixedRate(refreshTask, refreshPeriodInMillis,
                                      refreshPeriodInMillis);
            }
View Full Code Here

            if (RELATIVE_TIME_CHECK_MODE) {
                refreshTask = new CurrentTimeRefreshTask ();
                timer.scheduleAtFixedRate(refreshTask, timerFrequency*1000, timerFrequency*1000);
            } else {
                refreshTask = new RefreshTask();
                timer.scheduleAtFixedRate(refreshTask, refreshPeriodInMillis,
                                      refreshPeriodInMillis);
            }
        } else {
            refreshPeriodInMillis = 0;
        }
View Full Code Here

            final DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();
       
            verifyTargetInstance(domainRoot, instanceName);
            final ServerRootMonitor srm = getServerRootMonitor(domainRoot, instanceName);
            MonitorTask monitorTask = getTask(monitorType, srm, filterName, timer, verbose, fileName);
            timer.scheduleAtFixedRate(monitorTask, 0, interval);

            boolean done = false;
                // detect if a q or Q key is entered
            while (!done)
            {
View Full Code Here

  private void run(CommandLine line) throws Exception{
    Class updaterClass=Class.forName(line.getOptionValue("updater"));
    UpdateInterface updater=(UpdateInterface)updaterClass.newInstance();
    long delay=Long.parseLong(line.getOptionValue("timer"));
    Timer timer=new Timer();
    timer.scheduleAtFixedRate(new UpdateTimerTask(updater,line.getOptionValue("user"),line.getOptionValue("pass"),line.getOptionValue("url")),0,delay);
    while(true) {
      Thread.sleep(delay-20);
    }
  }
 
View Full Code Here

        final Timer timer = new Timer("BenchmarkTimerThread", true);

        final LinkedList<Long[]> snapshotList = new LinkedList<Long[]>();

        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                snapshotList.addLast(statsBenchmarkConsumer.createSnapshot());
                if (snapshotList.size() > 10) {
                    snapshotList.removeFirst();
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.