Package java.util.concurrent

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


    /*
     * This will execute the UimaAEJmxMonitor continuously for every 15
     * seconds with an initial delay of 20 seconds. This monitor polls
     * initialization status of AE deployed in UIMA AS.
     */
    executor.scheduleAtFixedRate(monitor, 20, 30, TimeUnit.SECONDS);
    // Future<Integer> future = executor.submit(callable);

    // Deploy components defined in Spring context files.
    // !!!! NOTE:This method blocks until the container is fully
    // initialized and all UIMA-AS components are successfully deployed
View Full Code Here


      client = new SparrowFrontendClient();
      client.initialize(new InetSocketAddress(schedulerHost, schedulerPort), APPLICATION_ID, this);

      JobLaunchRunnable runnable = new JobLaunchRunnable(tasksPerJob, taskDurationMillis);
      ScheduledThreadPoolExecutor taskLauncher = new ScheduledThreadPoolExecutor(1);
      taskLauncher.scheduleAtFixedRate(runnable, 0, arrivalPeriodMillis, TimeUnit.MILLISECONDS);

      long startTime = System.currentTimeMillis();
      LOG.debug("sleeping");
      while (System.currentTimeMillis() < startTime + experimentDurationS * 1000) {
        Thread.sleep(100);
View Full Code Here

    final ServletContext context = contextEvent.getServletContext();
    final Injector injector = getInjector();
    final UserPing ping = injector.getInstance(UserPing.class);
    final ScheduledThreadPoolExecutor timer = injector
        .getInstance(ScheduledThreadPoolExecutor.class);
    timer.scheduleAtFixedRate(ping, PING_START_DELAY, PING_CHECK_DELAY, TimeUnit.MILLISECONDS);
    serverStarted = new Date();
    context.setAttribute(INJECTOR, injector);
    context.setAttribute(DATE_NAME, serverStarted);

    reconfigureLogging(contextEvent.getServletContext());
View Full Code Here

    logger.debug("Awaiting async components for completion.");

    final CountDownLatch latch = new CountDownLatch(1);
    ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1);
    ScheduledFuture<?> handle = executor.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {

        // assure still in running state
        if (getState() != ProcessState.RUNNING) {
View Full Code Here

      return;

    final CountDownLatch latch = new CountDownLatch(1);

    ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1);
    ScheduledFuture<?> handle = executor.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {
        if (state == ProcessState.SUCCEEDED || state == ProcessState.FAILED)
          latch.countDown();
      }
View Full Code Here

    ScheduledThreadPoolExecutor ex5 = new ScheduledThreadPoolExecutor(1);
    ex1.scheduleAtFixedRate(new Task("EX1"), 10, 10, TimeUnit.MICROSECONDS);
    ex2.scheduleAtFixedRate(new Task("EX2"), 10, 10, TimeUnit.MICROSECONDS);
    ex3.scheduleAtFixedRate(new Task("EX3"), 10, 10, TimeUnit.MICROSECONDS);
    ex4.scheduleAtFixedRate(new Task("EX4"), 10, 10, TimeUnit.MICROSECONDS);
    ex5.scheduleAtFixedRate(new Task("EX5"), 10, 10, TimeUnit.MICROSECONDS);

    super.start();
  }

  public void run() {
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.