Automatically reload file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Automatically reload file

  1. #1
    Join Date
    Aug 2004
    Location
    australia
    Posts
    3

    Automatically reload file

    I have a java program that reads in a properties file when it's first run. This properties file has rules that determine how many threads are created with listeners. However we are constantly changing the propties files, adding rules, etc and everytime we do we have to stop and restart the program. I need a way to have a thread spinoff and constantly check the properties file, if it's lastModifiedDate is later than the previous lastModifiedDate than it reloads it otherwise goes back to sleep.

    I've looked around the net doing searches and can't seem to find anyone doing something similar - is it possible? I'm also thinking that this will present a new problem in that once it reloads the file it will create new threads for all of the rules that were previously created if they haven't been removed from the properties file. Is there a way around this too?

  2. #2
    Join Date
    Jun 2004
    Posts
    199
    Log4j Does it. But you have to set a parameter first. The code is OS so you should be able to see how they do it.

  3. #3
    Join Date
    Aug 2004
    Location
    australia
    Posts
    3
    Thanks, I had a look at the source and it was very useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center