-
Oct 31st, 2006, 05:07 AM
#1
Skip loading bean into context
Hi,
is there a way to influence loading of beans into application context, say, based on bean name, so that certain beans are loaded at startup, and other are not loaded (at startup, or any other time)?
-
Oct 31st, 2006, 05:51 AM
#2
You can set the "lazy-init" attribute to "true" to prevent eager initialization of singletons.
However, you cannot prevent to retrieve a bean at all. If that would be required, then why did you place it in the config in the first place?
Regards,
Andreas
-
Oct 31st, 2006, 09:13 AM
#3
thanks for the reply, I ended up using InstantiationAwareBeanPostProcessor, the reason I needed this in the first place is because one of my requirements is that the same application exists in different environments -- being lazy I did not want to write two sets of configuration xml's, but based on one (property) setting, I was worried that beans from irrelevant set would be loaded/initialized, but i circumvented that using InstantiationAwareBeanPostProcessor; thanks...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules