The project is Taskexecutor, and I think some of it is configured through the Spring bean. Some of them were configured in a way that looked at the official document, and the official document (as if it were chapter 30.5) was clearly written on the meaning of the parameters inside,
<bean id= "Taskexecutor" class= "Org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" >
< !--Core Thread Count-->
<property name= "corepoolsize" value= "${task.core_pool_size}"/>
<!--max Threads-->
<property name= "maxpoolsize" value= "${task.max_pool_size}"/>
<!--queue Maximum length-->
Name= "queuecapacity" value= "${task.queue_capacity}"/>
<!--thread pool to maintain the idle time allowed by the thread, by default 60s-->
< Property Name= "Keepaliveseconds" value= "${task.keep_alive_seconds}"/>
</bean>
<!--callout type-->
<task:annotation-driven/>
<!--or-->
<task:executor id= "Asynctaskexecutor"
Pool-size= "${executor.pool.size}"
queue-capacity= "${executor.queue.capacity}"
keep-alive= "/>"
As for the configuration/use of the SPRINGMVC consolidated Taskexecutor thread pool
First, configure Jdbc.properties add:
#------------Task------------
task.core_pool_size=5
task.max_pool_size=50
task.queue_capacity=1000
task.keep_alive_seconds=60
Second, configure Spring's applicationcontext.xml add:
is the configuration above.
Declaration and injection of IMPL in the implementation layer:
@Resource (name = "Taskexecutor")
private taskexecutor taskexecutor;
Four, in the method calls:
try {
Taskexecutor.execute (new Runnable () {public
void run () {
//write Processing business code
}
}});
catch (Exception e) {
e.printstacktrace ();
}