Results 1 to 2 of 2

Thread: Hot-Loading Beans?

  1. #1
    Join Date
    Nov 2004
    Posts
    5

    Default Hot-Loading Beans?

    Hey, ya'll...

    I've got a requirement for an ability to hot-load beans as the XML files change. I was wondering if anyone in the community had already thought about this as a future feature before I look at making mods myself.

    I was thinking that if I save the file and timestamp when a singleton is marshalled I should be able to check the file timestamp the next time the object is requested and reload it if its changed.

    What I don't know yet is what effects this scheme will have on any lingering references to an old bean instance. Would they toss an exception if referenced? Hmm.... I might need some coding best-practices even if the hot-load works.

    Cheers,
    Greg

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Search the forums; for example:

    http://forum.springframework.org/vie...ghlight=reload
    http://forum.springframework.org/vie...ghlight=reload
    http://forum.springframework.org/vie...ghlight=reload
    http://forum.springframework.org/vie...ghlight=reload
    What I don't know yet is what effects this scheme will have on any lingering references to an old bean instance. Would they toss an exception if referenced? Hmm.... I might need some coding best-practices even if the hot-load works.
    There are some papers related to this issues and how the JVM reacts. Basically if you use interfaces and not a concrete class, the JVM will start using the new class once it's redeploy - the old classes will be used however until the reference is lost. I.E.

    Client X requires class A v1.0.
    You deploy class A v2.0
    Client X still uses class A v1.0.
    Client Y will get class A v2.0
    Client X requires a new class A - gets v2.0.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Similar Threads

  1. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  2. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  3. problem loading beans from servlet
    By scottb022563 in forum Container
    Replies: 4
    Last Post: Jul 28th, 2005, 06:36 PM
  4. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  5. Manage ApplicationContext loading beans
    By vksoft in forum Container
    Replies: 2
    Last Post: Sep 18th, 2004, 02:46 PM

Posting Permissions

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