aspose file tools*
The moose likes Spring and the fly likes Multi-threading in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Multi-threading in Spring" Watch "Multi-threading in Spring" New topic
Author

Multi-threading in Spring

Khuma Chhakchhuak
Ranch Hand

Joined: Nov 30, 2012
Posts: 37

Can someone point me to multithreading/ multi-running of programs in java/Spring?

Thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30530
    
150

Can you elaborate on what you are looking for? Spring doesn't prevent multi-threading. In web apps, it is common for many users to come into the application at once.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2376
    
  28

Spring does provide the Task executor abstraction layer that allows you to run tasks in the background. You can configure them to run in threadpool. It also allows you to integrate with quartz which allows you to run your tasks periodically.

What you use, and how you use it depends on what you need to do. If you can elaborate, we can help you point in the right direction.
Khuma Chhakchhuak
Ranch Hand

Joined: Nov 30, 2012
Posts: 37

Hi all,

Jayesh's answers partly suffice my needs.

My need being running multiple junit tests on different browser/devices so I want them to run at the same time.

It would be great if you all can elaborate more on how to go about this.

Thanks,

Lalkhum
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2376
    
  28

You need to provide more details. Is the application being tested built using Spring, or are you planning to leverage Spring to do your testing? Are you concerned how your Spring managed components will behave in a multi threaded test environment? Are you trying to test concurrency, or are your just trying to speed up your testing by parallelizing it?

If all you want to run your tests in parallel, you really don;t need Spring. You just divide up your tests into Suites, and make sure each suite can be tested independently. Then all you do is kick off multiple JUnit tests, one for each suite. Boom, parallelized!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multi-threading in Spring