• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Making child threads of completion service as Spring aware

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).



 
No, tomorrow we rule the world! With this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic