java - Apache Commons Configuration trigger event on property file change -


i'm using apache commons configuration library store app properties. can monitor changes of property file using filechangedreloadingstrategy , works perfectly. trigger configurationchanged event of configurationlistener when property file changed.

this case works if try property code

directory = myconfiguration.getinstance().getstring("directory"); 

this line trigger configurationchanged. need event triggered when filechangedreloadingstrategy catches changes in file without doing redundant calls.

thanks.

the filechangedreloadingstrategy works checking file modification time every time read parameter. if don't read anything, apache configuration code not invoked there no way send notification you.

for app, more desirable because don't care file change until need use it.

you can write new strategy accomplish want. need start new thread , monitor file periodically.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -