Is it possible to autowire a Thread class in spring like controller, Service? If yes what annotation shall I use to autowire such a class?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Depending on what you are doing, I would consider using TaskExecutors instead of directly creating threads. This way thread lifecycle, pooling etc. is managed through the TaskExecutor.
See
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/scheduling.html