You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "technosf@speakeasy.net" <te...@speakeasy.net> on 2002/12/18 06:42:11 UTC

Resource loader event listener

Hello all,

I wondered if there are plans to implement a resource loader event listener?

What I would like to do is create an event listener that would get fired when a template has been touched and is reloaded. I need to sync to given templates, however I would prefer to avoid checking getLastModified() each time in the critical code, instead implementing a listener and have the resource loader issue a callback.


Thanks for your consideration!


TSF



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Resource loader event listener

Posted by "technosf@speakeasy.net" <te...@speakeasy.net>.
So poking around in the source it looks like it very do-able to add a listener to push out template modification times, especially for file-based templates. This would help me manage web cache HTTP calls to lastModified without having to call Template.getLastModified. I figure this interface would do:


public interface SourceModificationListener
{
	public void sourceModified( long modificationTime );
}



I'd love to give coding this a go. But does it make sense for this in Velocity? Have I missed something? Am I dumb?

OK, so awaiting flames   8-|


TSF


*********** REPLY SEPARATOR  ***********

On 12/17/2002 at 21:42 technosf@speakeasy.net wrote:

>Hello all,
>
>I wondered if there are plans to implement a resource loader event
>listener?
>
>What I would like to do is create an event listener that would get fired
>when a template has been touched and is reloaded. I need to sync to given
>templates, however I would prefer to avoid checking getLastModified() each
>time in the critical code, instead implementing a listener and have the
>resource loader issue a callback.
>
>
>Thanks for your consideration!
>
>
>TSF
>
>
>
>--
>To unsubscribe, e-mail:  
><ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>