All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----WebSite.Servlet.ServletClassLoader
Special class loader that can reload classes after modification. This is provided primarily for development environments, to alleviate the need for restarting the web server when a loaded servlet class has been modified and recompiled. There is a significant performance and memory penalty to using this reloading facility, so it is not recommended that you use this on production server systems. You can avoid using this class loader by putting your classes somewhere on the normal class path.
Do not directly access this class. It is used internally by the WebSite.Servlet package. It is not a subclass of java.lang.CLassLoader. It uses a private class that does the actual dirty work, and which subclasses java.lang.ClassLoader.
Classes to be checked and reloaded on update must be placed under a specific directory called the reloadable directory. This is essentially a special class path directory that is used only by this class loader. The directory is typically configured to be the path ...\WebSite\Java\classes\Reloadable. This must not appear in the server's configured class path!
If this fails, and the class is part of a package (in our example, package foo.bar) it looks for a jar or a zip file that contains the class. The search starts with the most specific name (in our example <reload-dir>\foo.bar.[jar|zip]) and tries for a jar file first, then a zip file. If is doesn't find either, it will strip successive elements from the name (in our example <reload-dir>\foo.[jar|zip]), and try jar then zip at eash stage. If it finds one, it will open it and look for the class using the pathname syntax as usual (\foo\bar\blat.class for our example) within the jar or zip archive. The archives may be compressed.
HKEY_LOCAL_MACHINE
Software
Denny
WebServer
CurrentVersion
Java
and change the ReloadableDir value to the path you want.
public ServletClassLoader(String dirName,
boolean debug)
public Class loadClass(String className) throws ClassNotFoundException
All Packages Class Hierarchy This Package Previous Next Index