aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making child threads of completion service as Spring aware
 
Similar Threads
J2ME + Bluetooth?
Process completes and abruptly stops its threads?
nonintrusive in spring
Book for Hibernate
How to make a thread return some value ?