You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jan Luehe <Ja...@Sun.COM> on 2003/04/24 21:38:13 UTC

Duplicate code for scanning TLD listeners

Costin,

I recently enhanced the functionality of scanning TLDs for listeners
to also consider globally shared JARs. I added this functionality to
org.apache.catalina.startup.TldConfig.

I just noticed scanning TLDs for listeners is also implemented in
org.apache.catalina.startup.ContextConfig.

I was wondering about the duplicate code, and stumbled
across this comment of yours in TldConfig:

----------------------------------------------------------------------------
revision 1.1
date: 2003/01/24 19:28:10;  author: costin;  state: Exp;
Refactored the tld listener configuration out of ContextConfig.

Cache the listeners in work/.../tldCache.ser ( as a String[] ). If the
file exists and is newer than all .jar and .tld - we'll not rescan/re-parse
those.

This needs to be called from Context ( right before START event ), and removed
from ContextConfig.
----------------------------------------------------------------------------

The "execute" method of TldConfig is now being invoked within the
"start" method of StandardContext, so it seems like we can remove the
code from ContextConfig.

If you don't have any objections, I'd like to apply the attached patch.

Please let me know what you think.

Thanks,


Jan




Re: Duplicate code for scanning TLD listeners

Posted by Costin Manolache <cm...@yahoo.com>.
Jan Luehe wrote:

> Costin,
> 
> I recently enhanced the functionality of scanning TLDs for listeners
> to also consider globally shared JARs. I added this functionality to
> org.apache.catalina.startup.TldConfig.
> 
> I just noticed scanning TLDs for listeners is also implemented in
> org.apache.catalina.startup.ContextConfig.
> 
> I was wondering about the duplicate code, and stumbled
> across this comment of yours in TldConfig:


+1 on eliminating the duplication, but I would like to preserve the caching.
Scanning dozens of jars is pretty slow, and it affects all applications (
even those that don't use jsps ).

Costin


> 
>
----------------------------------------------------------------------------
> revision 1.1
> date: 2003/01/24 19:28:10;  author: costin;  state: Exp;
> Refactored the tld listener configuration out of ContextConfig.
> 
> Cache the listeners in work/.../tldCache.ser ( as a String[] ). If the
> file exists and is newer than all .jar and .tld - we'll not
> rescan/re-parse those.
> 
> This needs to be called from Context ( right before START event ), and
> removed from ContextConfig.
>
----------------------------------------------------------------------------
> 
> The "execute" method of TldConfig is now being invoked within the
> "start" method of StandardContext, so it seems like we can remove the
> code from ContextConfig.
> 
> If you don't have any objections, I'd like to apply the attached patch.
> 
> Please let me know what you think.
> 
> Thanks,
> 
> 
> Jan



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org