Package java.util

Examples of java.util.Timer.scheduleAtFixedRate()


                listenerThread.start();

                Broadcaster broadcaster = new Broadcaster();

                Timer timer = new Timer("MulticastDiscovery: Broadcaster", true);
                timer.scheduleAtFixedRate(broadcaster, 0, heartRate);
            }
    }

    private void newSocket() throws IOException {
        InetAddress inetAddress = InetAddress.getByName(host);
View Full Code Here


        localTracker = getLocalNodeServiceTracker();

        NodeServiceHandlerThread nodeServiceHandlerThread = new NodeServiceHandlerThread();
        Timer timer = new Timer("WADIDiscoveryAgent: checkRemoteService", true);

        timer.scheduleAtFixedRate(nodeServiceHandlerThread, 0, heartRate);

        if (started.compareAndSet(false, true)) {

            Thread listenerThread = new Thread(listener);
            listenerThread.setName("WADIDiscoveryAgent: ListenerThread");
View Full Code Here

  @Override
  public void start(int delay) {
    synchronized (this) {
      if (!started) {
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {

          @Override
          public void run() {
            for (DataListener turnListener : getListeners()) {
              if (turnListener instanceof TurnListener) {
View Full Code Here

    final String className = words[0];
   
    // Set a timer running that will update reporter on a period.
    Timer t = new Timer(false);
   
    t.scheduleAtFixedRate(new TimerTask()
    {
      @Override
      public void run() {  
          reporter.setStatus("Running " + className);   
      }
View Full Code Here

      if (period == -1) {
        new MetricsTimerTask(plugin).run();
      } else {
        Thread.sleep(until - now);
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new MetricsTimerTask(plugin), 0,
            period * 1000);
      }
    } catch (Exception ex) {
      log.debug(ExceptionUtil.getStackTrace(ex));
    }
View Full Code Here

        //timer to update map
        int refreshrate = 250;

        //draws the map at given intervals
        Timer mapupdatetimer = new Timer();
        mapupdatetimer.scheduleAtFixedRate(new TimerTask(){

            @Override
            public void run() {
                viewer.repaint();
               
View Full Code Here

            }}, new Date(), refreshrate);
       

        //moves the seagulls at given intervals
        Timer gulltimer = new Timer();
        gulltimer.scheduleAtFixedRate(new TimerTask(){

            @Override
            public void run() {
               //move gulls
                ReferencedEnvelope mapbounds = map.getViewportModel().getBounds();
View Full Code Here

        //timer to update map
        int refreshrate = 300;

        //draws the map at given intervals
        Timer mapupdatetimer = new Timer();
        mapupdatetimer.scheduleAtFixedRate(new TimerTask(){

            @Override
            public void run() {
                viewer.repaint();
               
View Full Code Here

            }}, new Date(), refreshrate);
       

        //moves the seagulls at given intervals
        Timer gulltimer = new Timer();
        gulltimer.scheduleAtFixedRate(new TimerTask(){

            @Override
            public void run() {
               //move gulls
                ReferencedEnvelope mapbounds = map.getViewportModel().getBounds();
View Full Code Here

                if (editStatus.isEgoTestEnabled()) {
                    cycleAndMoveEgo();
                }
            }
        };
        timer.scheduleAtFixedRate(walkingTask, 100, 100);
    }
   
    /**
     * Gets the current cell in Image form, adjusted according to the priority
     * screen rules for the Ego's current position.
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.