Package org.springframework.scheduling.concurrent

Examples of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.afterPropertiesSet()


    ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setCorePoolSize(1);
    taskExecutor.setMaxPoolSize(1);
    taskExecutor.setQueueCapacity(0);
    taskExecutor.afterPropertiesSet();

    ThrottledTaskExecutor executor = new ThrottledTaskExecutor(taskExecutor, 10);
    service = new ExecutorCompletionService<String>(executor);

    service.submit(new Callable<String>() {
View Full Code Here


    factory.setCommitInterval(3);
    ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setCorePoolSize(3);
    taskExecutor.setMaxPoolSize(6);
    taskExecutor.setQueueCapacity(0);
    taskExecutor.afterPropertiesSet();
    factory.setTaskExecutor(taskExecutor);

  }
 
  @Test
View Full Code Here

    factory.setCommitInterval(3);
    ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setCorePoolSize(3);
    taskExecutor.setMaxPoolSize(6);
    taskExecutor.setQueueCapacity(0);
    taskExecutor.afterPropertiesSet();
    factory.setTaskExecutor(taskExecutor);

    factory.setSkipLimit(10);
    factory.setSkippableExceptionClasses(getExceptionMap(Exception.class));
View Full Code Here

    factory.setCommitInterval(3);
    ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setCorePoolSize(3);
    taskExecutor.setMaxPoolSize(6);
    taskExecutor.setQueueCapacity(0);
    taskExecutor.afterPropertiesSet();
    factory.setTaskExecutor(taskExecutor);
   
    JdbcTestUtils.deleteFromTables(new JdbcTemplate(dataSource), "ERROR_LOG");

  }
View Full Code Here

    ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setCorePoolSize(3);
    taskExecutor.setMaxPoolSize(6);
    taskExecutor.setQueueCapacity(0);
    taskExecutor.afterPropertiesSet();
    factory.setTaskExecutor(taskExecutor);

    @SuppressWarnings("unchecked")
    Map<Class<? extends Throwable>, Boolean> skippable = getExceptionMap(Exception.class);
    factory.setSkippableExceptionClasses(skippable);
View Full Code Here

    taskExecutor.setQueueCapacity(0);
    // This is the most sensible setting, otherwise the bookkeeping in
    // ResultHolderResultQueue gets out of whack when tasks are aborted.
    taskExecutor
        .setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
    taskExecutor.afterPropertiesSet();
    template.setTaskExecutor(taskExecutor);

    template.iterate(callback);
    int frequency = Collections.frequency(items, "null");
    // System.err.println("Frequency: " + frequency);
View Full Code Here

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(total);

        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(20);
        executor.afterPropertiesSet();
        for (int i = 0; i < 20; i++) {
            final int threadCount = i;
            executor.execute(new Runnable() {
                public void run() {
                    int start = threadCount * group;
 
View Full Code Here

    final CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
    connectionFactory.setHost("localhost");
    ThreadPoolTaskExecutor exec = new ThreadPoolTaskExecutor();
    final String execName = "make-sure-exec-passed-in";
    exec.setBeanName(execName);
    exec.afterPropertiesSet();
    connectionFactory.setExecutor(exec);
    final Field[] fields = new Field[1];
    ReflectionUtils.doWithFields(RabbitTemplate.class, new FieldCallback() {
      @Override
      public void doWith(Field field) throws IllegalArgumentException,
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.