List of usage examples for org.springframework.integration.util CompositeExecutor CompositeExecutor
public CompositeExecutor(Executor primaryTaskExecutor, Executor secondaryTaskExecutor)
From source file:org.springframework.integration.ip.tcp.connection.TcpNioConnectionTests.java
private CompositeExecutor compositeExecutor() { ThreadPoolTaskExecutor ioExec = new ThreadPoolTaskExecutor(); ioExec.setCorePoolSize(2);/*from w ww. j a v a2 s. c om*/ ioExec.setMaxPoolSize(4); ioExec.setQueueCapacity(0); ioExec.setThreadNamePrefix("io-"); ioExec.setRejectedExecutionHandler(new AbortPolicy()); ioExec.initialize(); ThreadPoolTaskExecutor assemblerExec = new ThreadPoolTaskExecutor(); assemblerExec.setCorePoolSize(2); assemblerExec.setMaxPoolSize(5); assemblerExec.setQueueCapacity(0); assemblerExec.setThreadNamePrefix("assembler-"); assemblerExec.setRejectedExecutionHandler(new AbortPolicy()); assemblerExec.initialize(); return new CompositeExecutor(ioExec, assemblerExec); }