Announcement Announcement Module
Collapse
No announcement yet.
Reload application context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reload application context

    Hi,

    We have several timer objects (Quartz) in the application context among other object for database access. A user can modify schedule times of these timer objects via a web application (applicationContext.xml).

    I am not sure, how to do this exactly. If I code a file scanner which reloads the application context if the user has made modifications via the web application, what are the implications, Does spring only reloads beans which have changed? Do I loose all beans? Does it help, if I just reload time objects in a separate application context (xml file).

    Thanks,

    Cyrill

  • #2
    Cyrill,

    If you are going to reload an ApplicationContext such as with:
    Code:
    ctx = new ClassPathXmlApplicationContext(..);
    Then you are going to see all beans being reloaded. This means that none of the bean instances previously available will be accessible,instead you will have new instances. The way around this is to create your own custom implementation of ApplicationContext and encapsulate the file checking logic in there. That way you can change just the beans that have changed.

    Rob

    Comment

    Working...
    X