Announcement Announcement Module
No announcement yet.
Simple Spring Question. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple Spring Question.

    Hi All,
    I'm newbie to Spring.
    Say, bean xml is loaded and I get application context.
    After this if I want to change the bean definition. Is it possible?
    If yes, how?
    This is particulary required when my bean is "quartz.JobDetailBean" and I need to change the parameters to poll a device dynamically. say interval, repeatCount etc.)

    Any help is appreciated.

  • #2
    Just an idea -- what if you implement your Spring bean as a JMX MBean, which can be modified on the fly? Then you can access your MBean via a JMX Agent (such as in JBoss) and modify the MBean's properties while it is running. I've never done this with Spring, but I imagine that it can be done.

    I hope this helps...



    • #3
      Of course, since a spring managed bean is still a bean, you can just change its properties at any time, especially a non-singleton.

      The problem is if this bean is part of "wiring" inside the context, how will dependent beans be updated or refreshed. One can use the method shown here

      Another problem is that any changes to a bean definition's properties are not persisted directly by Spring yet.
      Last edited by robyn; May 14th, 2006, 11:15 AM.