Package org.springframework.core.task

Examples of org.springframework.core.task.SimpleAsyncTaskExecutor


   * @see org.springframework.core.task.SimpleAsyncTaskExecutor#SimpleAsyncTaskExecutor(String)
   */
  protected TaskExecutor createDefaultTaskExecutor() {
    String beanName = getBeanName();
    String threadNamePrefix = (beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX);
    return new SimpleAsyncTaskExecutor(threadNamePrefix);
  }
View Full Code Here


  /**
   * Create a new {@code AsyncAnnotationAdvisor} for bean-style configuration.
   */
  public AsyncAnnotationAdvisor() {
    this(new SimpleAsyncTaskExecutor());
  }
View Full Code Here

   * @see org.springframework.core.task.SimpleAsyncTaskExecutor#SimpleAsyncTaskExecutor(String)
   */
  protected TaskExecutor createDefaultTaskExecutor() {
    String beanName = getBeanName();
    String threadNamePrefix = (beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX);
    return new SimpleAsyncTaskExecutor(threadNamePrefix);
  }
View Full Code Here

   * @see org.springframework.core.task.SimpleAsyncTaskExecutor#SimpleAsyncTaskExecutor(String)
   */
  protected TaskExecutor createDefaultTaskExecutor() {
    String beanName = getBeanName();
    String threadNamePrefix = (beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX);
    return new SimpleAsyncTaskExecutor(threadNamePrefix);
  }
View Full Code Here

            // defined by maxConcurrentConsumers).
            answer.setQueueCapacity(0);
            answer.initialize();
            return answer;
        } else {
            SimpleAsyncTaskExecutor answer = new SimpleAsyncTaskExecutor(beanName);
            answer.setThreadFactory(new CamelThreadFactory(pattern, beanName, true));
            return answer;
        }
    }
View Full Code Here

            // defined by maxConcurrentConsumers).
            answer.setQueueCapacity(0);
            answer.initialize();
            return answer;
        } else {
            SimpleAsyncTaskExecutor answer = new SimpleAsyncTaskExecutor(beanName);
            answer.setThreadFactory(new CamelThreadFactory(pattern, beanName, true));
            return answer;
        }
    }
View Full Code Here

            // defined by maxConcurrentConsumers).
            answer.setQueueCapacity(0);
            answer.initialize();
            return answer;
        } else {
            SimpleAsyncTaskExecutor answer = new SimpleAsyncTaskExecutor(beanName);
            answer.setThreadFactory(new CamelThreadFactory(pattern, beanName, true));
            return answer;
        }
    }
View Full Code Here

            jmsListener.setDestinationResolver(jmsConfig.getDestinationResolver());
        }
        if (jmsConfig.getTaskExecutor() != null) {
            jmsListener.setTaskExecutor(jmsConfig.getTaskExecutor());
        } else {
            SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
            taskExecutor.setConcurrencyLimit(jmsConfig.getMaxConcurrentTasks());
            jmsListener.setTaskExecutor(taskExecutor);
        }
        if (jmsConfig.isAutoResolveDestination()) {
            jmsListener.setDestinationName(destinationName);
        } else {
View Full Code Here

        super();
    }

    @Test
    public void testExecutionMethod() throws InterruptedException {
        AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor("tTestExecutionMethod");
        SignallingRunnable runner = new SignallingRunnable("testExecutionMethod");
        executor.execute(runner, 125L);

        assertLastExecutionOperation(runner);
        assertCurrentThreadExecution();
    }
View Full Code Here

        assertCurrentThreadExecution();
    }

    @Test
    public void testSubmissionMethod() throws InterruptedException, ExecutionException, TimeoutException {
        AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor("testSubmissionMethod");
        SignallingRunnable runner = new SignallingRunnable("testSubmissionMethod");
        Future<?> future = executor.submit(runner);
        Object result = future.get(5L, TimeUnit.SECONDS);

        assertLastExecutionOperation(runner);
        assertCurrentThreadExecution();
View Full Code Here

TOP

Related Classes of org.springframework.core.task.SimpleAsyncTaskExecutor

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.