wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Replacing property file (caching a property file) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Replacing property file (caching a property file)" Watch "Replacing property file (caching a property file)" New topic
Author

Replacing property file (caching a property file)

Inshar Anas
Greenhorn

Joined: Apr 02, 2009
Posts: 21
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

Joined: Apr 14, 2004
Posts: 10336


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

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



JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Inshar Anas
Greenhorn

Joined: Apr 02, 2009
Posts: 21
what do you mean?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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
Ranch Hand

Joined: Apr 04, 2009
Posts: 497
    
    5
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

Joined: Apr 02, 2009
Posts: 21
Thank you very much Paul and Karthik!!! Your information helped me a lot!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Replacing property file (caching a property file)