Announcement Announcement Module
Collapse
No announcement yet.
Simple Spring Question. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.
    thanks,
    anagha

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


    --James

    Comment


    • #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 http://forum.springframework.org/showthread.php?t=12401

      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, 10:15 AM.

      Comment

      Working...
      X