Martin Schulz <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I would like to know whether I can control the cacheing
> behavior of org.apache.catalina.loader.WebappClassLoader
> somehow.
> 
> For the purpose of developing a server application, I would
> like to be able to drop in config files and other resource
> files such as scripts and be able to reload them
> programmatically through
> myclass.class.getResourceAsStream(myResource).
> 
> Since WebappClassLoader diligently caches all resources
> in a HashMap, the resource file can never be reloaded.
> 
> Subclassing WebappClassLoader is an option, but I'd like to
> avoid modifying the tomcat jar if possible.
> 
> Are there any workarounds this restriction
> e.g. by using getResource URL et al. which will not ultimately
> wind up accessing the same cache?

Have you tried configuring the Loader to tell the classloader to check
for modified resources?  You can specify the checkInterval in number
of seconds.

  <Loader checkInterval="1"
          className="org.apache.catalina.loader.WebappLoader"/>

(Note that WebappLoader is a different class than WebappClassLoader.)
-- 

Daniel Rall <[EMAIL PROTECTED]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to