Results 1 to 2 of 2

Thread: Reload application context

  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    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

Similar Threads

  1. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  2. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  3. Replies: 6
    Last Post: May 8th, 2005, 11:09 AM
  4. Questioning the core component
    By Martin Kersten in forum Swing
    Replies: 6
    Last Post: Feb 21st, 2005, 03:45 AM
  5. Hierarchical application context in J2EE app
    By cmgharris in forum Container
    Replies: 2
    Last Post: Sep 13th, 2004, 04:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •