Package org.springframework.scheduling.concurrent

Examples of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler


    return new ServerWebSocketHandler();
  }

  @Bean
  public ThreadPoolTaskScheduler sockJsTaskScheduler() {
    ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
    taskScheduler.setThreadNamePrefix("SockJS-");
    return taskScheduler;
  }
View Full Code Here


  logger.debug("Starting app in: " + System.getProperty("user.dir"));

  // Load Spring context
  AbstractApplicationContext context = new ClassPathXmlApplicationContext("app-context.xml");
  ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler) context.getBean("pmScheduler");

  @SuppressWarnings("unchecked")
  ArrayList<ProcessCheckTask> processCheckTaskList = (ArrayList<ProcessCheckTask>) context
    .getBean("processCheckTaskList");

  // Schedule the process check tasks
  for (ProcessCheckTask task : processCheckTaskList) {
      ScheduledFuture<?> future = scheduler.schedule(task, new CronTrigger(task.getCron()));
      task.setScheduledFuture(future);
  }

  while (!Thread.interrupted()) {
      try {
    Thread.yield();
    Thread.sleep(2000);
      } catch (InterruptedException e) {
    logger.error("Thread error: " + e.getMessage());
      }
  }

  logger.debug("Stopping app...");

  scheduler.shutdown();
  context.close();

  logger.debug("Application stopped.");

  System.exit(0);
View Full Code Here

    return new PerSessionJsonRpcHandler(beanName, beanClass);
  }

  @Bean(destroyMethod = "shutdown")
  public TaskScheduler jsonrpcTaskScheduler() {
    return new ThreadPoolTaskScheduler();
  }
View Full Code Here

        return executor;
    }

    @Bean
    public ThreadPoolTaskScheduler taskScheduler() {
        return new ThreadPoolTaskScheduler();
    }
View Full Code Here

    }
  }

  @Bean(destroyMethod = "shutdown")
  public TaskScheduler repositoryTaskScheduler() {
    return new ThreadPoolTaskScheduler();
  }
View Full Code Here

@EnableJpaRepositories
class IndexerConfig {

    @Bean
    public TaskScheduler scheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(10);
        return scheduler;
    }
View Full Code Here

  @Override
  @Before
  public void setUp() {
    super.setUp();
    this.service = new TestSockJsService(new ThreadPoolTaskScheduler());
  }
View Full Code Here

      taskRegistrar.setScheduler(taskScheduler2());
    }

    @Bean
    public TaskScheduler taskScheduler1() {
      ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
      scheduler.setThreadNamePrefix("explicitScheduler1-");
      return scheduler;
    }
View Full Code Here

      return scheduler;
    }

    @Bean
    public TaskScheduler taskScheduler2() {
      ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
      scheduler.setThreadNamePrefix("explicitScheduler2-");
      return scheduler;
    }
View Full Code Here

      return new ThreadAwareWorker();
    }

    @Bean
    public TaskScheduler taskScheduler1() {
      ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
      scheduler.setThreadNamePrefix("explicitScheduler1-");
      return scheduler;
    }
View Full Code Here

TOP

Related Classes of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler

Copyright © 2018 www.massapicom. 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.