5 Elements of a spring thread pool

Source: Internet
Author: User

<? XML version= "1.0" encoding="UTF-8"?>

<! DOCTYPE beans Public "-//spring//dtd bean//en" "/spring-beans.dtd">

<beans>

<!--an asynchronous thread pool--

<Bean id= "threadPool" class=" Org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor ">

<!--number of core threads--

<property name= "corepoolsize" value= "ten" />

<!--maximum Thread count--

<property name= "maxpoolsize" value= " /> "

<!--queue Maximum length >=mainexecutor.maxsize--

<property name="queuecapacity" value= " /> "

<!--thread pool to maintain idle time allowed by threads--

<property name= "keepaliveseconds" value= " /> "

<!--thread pool processing policy for rejected tasks (wireless path available)--

<property name="Rejectedexecutionhandler">

<Bean class="Java.util.concurrent.threadpoolexecutor$callerrunspolicy" />

</Property>

</Bean>

<Bean id="Mainexecutor" class= "supben. Mainexecutor ">

<property name= "threadPool" ref="ThreadPool" />

</Bean>

<Bean id= "springscheduleexecutortask" class=" Org.springframework.scheduling.concurrent.ScheduledExecutorTask ">

<property name= "runnable" ref="Mainexecutor" />

<!--container starts to execute after 10 seconds

<property name="delay" value="10000" />

<!--each task interval 5 seconds--

<property name= "period" value= " /> "

</Bean>

<Bean id= "springscheduledexecutorfactorybean" class=" Org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean ">

<property name="Scheduledexecutortasks">

<list>

<ref bean="Springscheduleexecutortask" />

</list>

</Property>

</Bean>

</Beans>

5 Elements of a spring thread pool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.