Announcement Announcement Module
Collapse
No announcement yet.
Skip loading bean into context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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)?

  • #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

    Comment


    • #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...

      Comment

      Working...
      X