HI, I am woring on a MOM system, where we load the application specific values from an XML file thru a servlet init() method during the application start up time and put into a hashtable with key-value pair. A Singleton class is created to access these values. Now i want to change the xml file and refresh the hashtable with the new values without restarting the server. Is there any option to do it? Thanks, Ansa
No, the class contains methods such as put,get,add and remove objects, which inturns calls another class which extends Hashtable. It is possible to clear all the contents and create the new instance by manually. But i want this to be done automatically whenever/immediately the file get changed. Thanks, Ansa [ April 17, 2008: Message edited by: Ansa Suseelan ]
You have a a logic in the singleton class like whenver someone tries to get the any value from hashtable you can check whether the file contents are changed before returning the value and then update the hashtable and then return the new value.
Joined: Apr 09, 2008
Thanks, the logic sounds ok, but this will affect the performance !!! In this logic we will have to check the file property each time we access the hashtable. As I have mentioend earlier its a MOM system processing >1M records daily. Is there any listener available for file change or folder change?