phoenix
phoenix

Reputation: 3621

Multi-threaded capabilities of the spring container?

If I want to run a Spring enabled Java application that does document processing, does the container offer me multithreaded capabilities on its own? I don't have any multithreaded code within the application but I am wondering how I would benefit from the multithreading offered by the Spring container?

Upvotes: 1

Views: 5560

Answers (2)

secreteyes
secreteyes

Reputation: 351

There is no multi-threading support as such in Spring, other then help in coordinating/scheduling execution of tasks through Quartz. Multithreaded execution of code in Spring is no different then if you were to do it in a stand-alone java app. If you've got singletons and do not keep state in beans then you are just good to go. Following is a great articles that will clarify a lot of issues regarding Spring and thread-safety:

http://www.javalobby.org/articles/thread-safe/index.jsp?source=archives

Upvotes: 1

duffymo
duffymo

Reputation: 308984

You can leverage the Spring ThreadPoolTaskExecutor. it will mean changing your application - Spring is smart, but it can't read you mind.

http://static.springsource.org/spring/docs/3.0.x/reference/scheduling.html

Upvotes: 2

Related Questions