Gerhard Froehlich a écrit :
>
> Hi,
> I implemented the Excalibur Resource Monitor into
> Cocoon.java. The Resource Monitor observes now
> the cocoon.xconf file and notifies Cocoon.java,
> when the file has changed.
>
> Cheers
> Gerhard
>
Sorry to be so annoying about resource and monitors, but from a design
point of view, I think using ActiveMonitor this way is overkill.
As Berin said, the purpose of ActiveMonitor is to trigger some action
when a resource changes. Just changing the "lastModified" attribute
isn't IMO an action that justifies a background thread to periodically
monitor the filesystem.
On the other hand, the FileResource with delayed call to
File.lastModified() I proposed yesterday (see
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=100799905918225&w=2 )
seems to me more appropriate in this case :
- only Cocoon uses cocoon.xconf, and it already keeps the associated
Source object as an attribute. So there's no need to register it in a
centralized monitor.
- like ActiveMonitor, it reduces the number of filesystem calls and
ensures the age of the "lastModified" information isn't greater that the
refresh period, but unlike ActiveMonitor, doesn't refresh it
unnecessarily at _every_ refresh period.
Thoughts ?
Sylvain.
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]