Examples of scheduleAtFixedRate()


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

        }
        if (getCompletionInterval() > 0) {
            LOG.info("Using CompletionInterval to run every " + getCompletionInterval() + " millis.");
            ScheduledExecutorService scheduler = camelContext.getExecutorServiceStrategy().newScheduledThreadPool(this, "AggregateTimeoutChecker", 1);
            // trigger completion based on interval
            scheduler.scheduleAtFixedRate(new AggregationIntervalTask(), 1000L, getCompletionInterval(), TimeUnit.MILLISECONDS);
        }

        // start timeout service if its in use
        if (getCompletionTimeout() > 0 || getCompletionTimeoutExpression() != null) {
            LOG.info("Using CompletionTimeout to trigger after " + getCompletionTimeout() + " millis of inactivity.");
View Full Code Here

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

     * Due to the lack of contract in CDI guaranteeing when beans will be available, we use an
     * executor to search for the beans every 100ms until it finds them. Or, after a 25 seconds,
     * blow up if they don't become available.
     */
    final ScheduledExecutorService startupScheduler = Executors.newScheduledThreadPool(1);
    startupScheduler.scheduleAtFixedRate(new StartupCallback(beanManager, bus, startupScheduler, 25), 0, 100,
            TimeUnit.MILLISECONDS);

    for (final Class<?> remoteInterfaceType : managedTypes.getRemoteInterfaces()) {
      createRPCScaffolding(remoteInterfaceType, bus, beanManager);
    }
View Full Code Here

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

    this.executer = Executors
        .newFixedThreadPool(NUMBER_OF_PARALLEL_REQUESTS);
    if (SHOW_DEBUG_PROCESSINGS_LIST) {
      ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
     
      scheduler.scheduleAtFixedRate(displayMap, 0, 1, TimeUnit.MINUTES);
    }
  }

  private Logger l = Logger.getLogger(this.getClass());
View Full Code Here

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

Examples of lineage2.gameserver.ThreadPoolManager.scheduleAtFixedRate()

    }
    else if (type == TYPE_FIXED_SHEDULED)
    {
      long delay = Long.valueOf(task.getParams()[0]);
      long interval = Long.valueOf(task.getParams()[1]);
      task._scheduled = scheduler.scheduleAtFixedRate(task, delay, interval);
      return true;
    }
    else if (type == TYPE_TIME)
    {
      try
View Full Code Here

Examples of org.teiid.dqp.internal.process.ThreadReuseExecutor.scheduleAtFixedRate()

      pool.execute(new FakeWorkItem(1));
    }
   
    @Test public void testScheduleCancel() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
      ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
        @Override
        public void run() {
        }
      }, 0, 5, TimeUnit.MILLISECONDS);
      future.cancel(true);
View Full Code Here

Examples of org.teiid.dqp.internal.process.ThreadReuseExecutor.scheduleAtFixedRate()

     * Here each execution exceeds the period
     */
    @Test public void testScheduleRepeated() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
      final ArrayList<String> result = new ArrayList<String>();
      ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
        @Override
        public void run() {
          result.add("hello"); //$NON-NLS-1$
          try {
          Thread.sleep(70);
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.