• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replacing property file (caching a property file)

 
Inshar Anas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i need to find a replacement for the *.property file.
because, if we update a property file, we need to restart the server. So, i need to find a method, where i can change the property values without restarting the server.
I am using java 1.4 and the server is web sphere.
need help from you all!
thanks!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

because, if we update a property file, we need to restart the server

Why? Could you not just poll the properties file for changes?


 
Inshar Anas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a timer task (or something simmilar) that checks the porperties files periodically and reloads them if they've been updated (perhaps by keeping track of the modification dates or something).
 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Another option is to use the Apache Commons Configurations library. It supports runtime reloading of property files, and even modification of property files.
 
Inshar Anas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Paul and Karthik!!! Your information helped me a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic