Results 1 to 5 of 5

Thread: How to relaod a bean i ApplicationContext

  1. #1
    Join Date
    Jan 2011
    Posts
    2

    Default How to relaod a bean i ApplicationContext

    Hi,
    I am trying to see if i can update one bean from the ApplicationContext by avoiding the ApplicationContext.refersh() method.

    Any help on this greatly appreciated.

    Thank you.
    Vj

  2. #2
    Join Date
    Dec 2010
    Location
    Singapore
    Posts
    302

    Default

    if i can update one bean from the ApplicationContext
    What do you mean by update the the bean? You mean its properties?
    Amila Domingo

  3. #3
    Join Date
    Jan 2011
    Posts
    2

    Default

    My situation is like
    I have a bean definition in the xml which i loaded as part of my application during the startup.
    But after some time some one updated the one of the property of the bean.
    I want reload the updated properties of the bean during the runtime.

  4. #4
    Join Date
    Mar 2010
    Location
    Genoa, Italy
    Posts
    35

    Default

    You can give prototype scope to your bean and ask the context to create a new one each time you need to "reload" it. Of course, any other bean that is a property of your refreshable bean and that you want to update must be in prototype scope as well.

  5. #5
    Join Date
    Sep 2007
    Location
    Colombo
    Posts
    20

    Default

    Hi,

    You can even use the following way using prototype scope

    http://stackoverflow.com/questions/3...pe-not-working
    Cheers!
    Duminda Ekanayake

Posting Permissions

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