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

  • Persist Spring Configuration

    Hi, i am writing a simple server atm. For configuration purposes i took springframework. I have exposed some of my beans to my local MBeanServer. It works perfectly, and now it is possible to change server configuration on the fly. The only problem i have, i cant figure out how do i persist the changes i made to beans back in configuration xml...

    Any clue how i can do it?


    tnx a lot.

  • #2
    AFAIK spring doesn't offer such built-in facility. Also it would be rather complex to correctly change reference types (different interdependencies defined at container may be broken).

    However, it easy to do the stuff with the primitive or String/Class properties via the following:
    1. Customize spring-managed MBeans exposing in order to subscibe for their JMX notifications (check reference - JMX);
    2. Persist new property value every time MBean attribute is changed (e.g. via Preferences API)
    3. Introduce a separate bean post processor that reads stored properties data and updates bean properties accordingly;

    Comment

    Working...
    X