tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chetan Sabnis <>
Subject JK2: Patch to allow dynamic additions to handled URIs
Date Thu, 15 Apr 2004 14:54:22 GMT

I needed to be able to add URIs handled by JK2 to the config file and have those new endpoints work
dynamically, without restarting Apache 2.  The existing code to reload
the config file when hitting the status worker page accomplished 99% of
the work.  The included patch file does the extra 1% needed to handle
new URIs.

1) Adds a refresh method to the UriMap data structure
2) Adds a checkVersion method to workerEnv data structure to compare
config version against shared memory segment and reload config if
necessary.  This is similar to what the lb worker does, and was
necessary to support multi-process operation.
3) checkVersion call was added to the jk2_translate hook.  This is
because the data structures must be reloaded before the translation
phase of mod_jk2.  Once again, this was necessary for multi-process

The patch can be applied against the 2.0.4 release of the JK2 source
tarball.  It has been tested with Apache 2.0.49 with Tomcat 4.1.29 on
RHEL 3 and Fedora.  It has been tested multi-threaded, multi-process
using the worker MPM.

We at Epok are contributing this patch back to the Jakarta community
with no claims on copyright and no warranty.  You can do whatever you
want to with this code without contacting me or Epok.  It would be nice
to have this functionality incorporated into JK2 in some future
release.  Clearly, this functionality would be implemented differently
if done by the Tomcat developer team.  Hopefully, this patch can serve
as a reference.

Keep up the good work,


View raw message