Package java.util.concurrent

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()


    super.init();
    mountPage("feed", FeedPage.class);
    mountPage("add-content", AddContentPage.class);
   
    ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);
    executor.scheduleAtFixedRate(new TimestamperTask(this), 0, 30, TimeUnit.SECONDS);
  }
}
View Full Code Here


                    periodical.getClass().getCanonicalName(),
                    periodical.getInitialDelaySeconds(),
                    periodical.getPeriodSeconds());

            ScheduledExecutorService scheduler = periodical.isDaemon() ? this.daemonScheduler : this.scheduler;
            ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(
                    periodical,
                    periodical.getInitialDelaySeconds(),
                    periodical.getPeriodSeconds(),
                    TimeUnit.SECONDS
            );
View Full Code Here

        task = new GamePlay(IAM.DEFENDER, session);
      }
      else{
        task = new GamePlay(IAM.ZOMBIE, session);
      }
      taskExecutor.scheduleAtFixedRate(task, 2000, 200, TimeUnit.MILLISECONDS);
    }
  }
 
  private static void addDefaultHandlerToSession(Session session)
  {
View Full Code Here

        task = new GamePlay(IAM.DEFENDER, session);
      }
      else{
        task = new GamePlay(IAM.ZOMBIE, session);
      }
      taskExecutor.scheduleAtFixedRate(task, 2000, 200, TimeUnit.MILLISECONDS);
    }
  }

  private static AbstractSessionEventHandler getDefaultHandler()
  {
View Full Code Here

        }
      }
    });
   
    ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
    scheduler.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {
        try {
          scrobbleTracks();
        } catch (Throwable t) {
View Full Code Here

        }
      }
    });
   
    ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
    scheduler.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {
        try {
          scrobbleTracks();
        } catch (Throwable t) {
View Full Code Here

  private void startTagUpdateService() {

    ScheduledExecutorService scheduler = Executors
        .newSingleThreadScheduledExecutor();
    scheduler.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {
        try {
          updateTags();
        } catch (Throwable t) {
View Full Code Here

                    System.err.println("Negative value spotted for openConnection metric: " + value);
                    negativeOpenConnectionCountSpotted.set(true);
                }
            }
        };
        openConnectionsWatcherExecutor.scheduleAtFixedRate(openConnectionsWatcher, 1, 1, SECONDS);

        // Insert 100k lines in a newly created 1k columns table
        PreparedStatement insertStatement = session.prepare(generateJava349InsertStatement());
        for (int key = 0; key < numberOfInserts; key++) {
            session.executeAsync(insertStatement.bind(key)).addListener(progressReporter, progressReportExecutor);
View Full Code Here

                int inFlight = session.getState().getInFlightQueries(host);
                if (inFlight > maxRequests)
                    excessInflightQueriesSpotted.set(true);
            }
        };
        openConnectionsWatcherExecutor.scheduleAtFixedRate(openConnectionsWatcher, 200, 200, TimeUnit.MILLISECONDS);

        // Generate the load
        for (int i = 0; i < 10000; i++)
            session.executeAsync("SELECT release_version FROM system.local");
View Full Code Here

    //Schedule Nimbus monitor
    MonitorRunnable r1 = new MonitorRunnable(data);
   
    int monitor_freq_secs = (Integer) conf.get(Config.NIMBUS_MONITOR_FREQ_SECS);
    scheduExec.scheduleAtFixedRate(r1, monitor_freq_secs, monitor_freq_secs,TimeUnit.SECONDS);
   
    //Schedule Nimbus inbox cleaner.����/nimbus/inbox�¹��ڵ�jar
    String dir_location=StormConfig.masterInbox(conf);
    int inbox_jar_expiration_secs=(Integer)conf.get(Config.NIMBUS_INBOX_JAR_EXPIRATION_SECS);
    CleanRunnable r2 = new CleanRunnable(dir_location,inbox_jar_expiration_secs);
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.