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


   * with the specified bean name (or the class name, if no bean name specified) as thread name prefix.
   * @see org.springframework.core.task.SimpleAsyncTaskExecutor#SimpleAsyncTaskExecutor(String)
   */
  protected TaskExecutor createDefaultTaskExecutor() {
    String threadNamePrefix = (beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX);
    return new SimpleAsyncTaskExecutor(threadNamePrefix);
  }
View Full Code Here

      return new AsyncProcess();
    }

    @Bean
    public SimpleAsyncTaskExecutor portalPoolTaskExecutor() {
      return new SimpleAsyncTaskExecutor("ppte-");
    }
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

            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

  @Test
  public void taskExecutor() throws Exception {

    URI uri = new URI("ws://example.com/abc");
    this.wsClient.setTaskExecutor(new SimpleAsyncTaskExecutor());
    WebSocketSession session = this.wsClient.doHandshake(this.wsHandler, this.headers, uri).get();

    assertNotNull(session);
  }
View Full Code Here

  public void doHandshakeWithTaskExecutor() throws Exception {

    WebSocketHttpHeaders headers = new WebSocketHttpHeaders();
    headers.setSecWebSocketProtocol(Arrays.asList("echo"));

    this.client.setTaskExecutor(new SimpleAsyncTaskExecutor());
    this.wsSession = this.client.doHandshake(new TextWebSocketHandler(), headers, new URI(this.wsUrl)).get();

    assertEquals(this.wsUrl, this.wsSession.getUri().toString());
    assertEquals("echo", this.wsSession.getAcceptedProtocol());
  }
View Full Code Here

   * Create a new instance of the {@code AsyncRestTemplate} using default settings.
   * <p>This constructor uses a {@link SimpleClientHttpRequestFactory} in combination
   * with a {@link SimpleAsyncTaskExecutor} for asynchronous execution.
   */
  public AsyncRestTemplate() {
    this(new SimpleAsyncTaskExecutor());
  }
View Full Code Here

    }
    catch (ClassNotFoundException ex) {
      // If EJB 3.1 API not present, simply ignore.
    }
    if (executor == null) {
      executor = new SimpleAsyncTaskExecutor();
    }
    if (exceptionHandler != null) {
      this.exceptionHandler = exceptionHandler;
    }
    else {
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

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.