This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Making child threads of completion service as Spring aware Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Making child threads of completion service as Spring aware" Watch "Making child threads of completion service as Spring aware" New topic
Author

Making child threads of completion service as Spring aware

Aditya Keyal
Ranch Hand

Joined: Dec 01, 2008
Posts: 71
Hi,
I am using the spring 2.5.x and Java 5. My requirement is to run a few processes in parallel using CompletionService (Java 5).
The code is structured as below :
MyCompletionServiceImpl adds 4 different MyCallableImpl . All the above are spring beans. However the tasks that are performed within the callable implementation in turn invoke use some classes (again spring injected) which have DB operations and some ApplContext.getBean calls. However the ApplContext.getBean does not result in the correct bean being found. (Which is available in the original spring context). Can someone please advise on how do we make child threads spring aware. (I cannot reload the spring files in the child threads since performance will take a major hit).




- Aditya Webservices Blog
 
Consider Paul's rocket mass heater.
 
subject: Making child threads of completion service as Spring aware
 
Similar Threads
nonintrusive in spring
J2ME + Bluetooth?
How to make a thread return some value ?
Book for Hibernate
Process completes and abruptly stops its threads?