Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Spring Context created in multiple threads?
Spring Context created in multiple threads? [message #1132909] Fri, 11 October 2013 09:22
Sven Panko is currently offline Sven Panko
Messages: 13
Registered: February 2011
Location: Germany
Junior Member
Hey guys,

upon investigating why asynchronously creating Spring contexts in a plan-driven deployment causes problems I stumbled across an observation that I wanted to clarify. I have a Spring-powered bundle that is configured via 4 XML files. Most of the beans are defined in those XML files. However, one of the XML files also contained the context:component-scan element to power up additional beans (don't know if this is relevant or not). When the bundle's Spring context is started I can see that some beans are started within the context of thread A, then something pauses and the remaining beans are initialized on thread B.

The log messages from thread A indicate that the XML files are loaded and some beans are initialized. Thread B initializes the remaining beans, namely those that are found via the context:component-scan element and (since I also use Spring Data) those that are loaded via the sd:repositories element, which basically also performs classpath scanning.

My question is: is this "normal" behavior as such that Spring (DM) uses different threads to load beans from XML files and does the annotation voodoo stuff afterwards in a different thread? That's at least the common denominator I can detect, because the log output from Thread B only contains references to beans defined in the XML file that contains the above-mentioned classpath-scanning elements. Beans from other XML files are loaded in Thread A.

Thanks in advance

Sven
Previous Topic:InfoQ interview on Virgo
Next Topic:Bundles inside plans are started concurrently, causing problems
Goto Forum:
  


Current Time: Thu Apr 24 01:36:51 EDT 2014

Powered by FUDForum. Page generated in 0.01647 seconds