Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

apache commons jci package  RSS feed

 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to test run an example given here:
on apache site

In particular, I am trying to run the example link at the bottom on the above link..
test example

I downloaded the commons package etc etc, compile goes fine, runs fine too, however, nothing happens when I change the test file (added new properties, deleted properties etc).. I don't even see the 'configuration changed' message. However the thread polling seems to work fine, but looks like control never goes to the hasChanged() conditional check.

Can someone please help me in understanding this behaviour? It is driving me nuts.
[ April 29, 2008: Message edited by: Brian Percival ]
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The FilesystemAlterationMonitor class that is used to detect the modification in files is a thread that wakes up after every 3 seconds to check whether the file has been modified.
Based on the timing of your properties file change and the check by the thread, the configuration change handling may not be instantaneous. Are you sure you waited for sometime and it did not trigger.


[Disclaimer: I have never worked on JCI, but out of curiosity i just saw the link that you have posted!]
 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitesh,

I waited like forever.. It never even printed the "Configuration changed". The only thing I can think of doing different is I did not include the example class as member of the examples package.

I just wanted to test and so removed that one package specification statement at the top (so I made it member of th default package).

And it didn't work.

I already have a file monitor implementation, I just wanted to replace it with something standard (like apache commons). No luck.

thanks for your time. I know people are wary of this threads section since if we screw up something it really takes long time to figure out what's happening. So I really appreciate your trying to help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!