org.apache.tomcat.core
Interface ServletLoader


public interface ServletLoader

Handle servlet and resource reloading


Method Summary
 void addRepository(java.io.File f, java.lang.Object protectionDomain)
          Add a new directory or jar to the class loader.
 void addRepository(java.net.URL url)
          Add a new remote repository.
 java.lang.ClassLoader getClassLoader()
          Return a real class loader
 java.lang.String getClassPath()
          Return the class loader view of the class path
 java.lang.ClassLoader getParentLoader()
           
 java.lang.Class loadClass(java.lang.String name)
          Handle servlet loading.
 void reload()
          Reset the class loader.
 void setParentLoader(java.lang.ClassLoader parent)
          The parent loader - used to load tomcat classes.
 boolean shouldReload()
          Check if we need to reload.
 boolean shouldReload(java.lang.String className)
          Check if we need to reload one particular class.
 

Method Detail

shouldReload

public boolean shouldReload(java.lang.String className)
Check if we need to reload one particular class. No check is done for dependent classes. The final decision about reloading is left to the caller.

shouldReload

public boolean shouldReload()
Check if we need to reload. All loaded classes are checked. The final decision about reloading is left to the caller.

reload

public void reload()
Reset the class loader. The caller should take all actions required by this step ( free resources for GC, etc)

getClassLoader

public java.lang.ClassLoader getClassLoader()
Return a real class loader

loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Handle servlet loading. Same as getClassLoader().loadClass(name, true);

getClassPath

public java.lang.String getClassPath()
Return the class loader view of the class path

addRepository

public void addRepository(java.io.File f,
                          java.lang.Object protectionDomain)
Add a new directory or jar to the class loader. Optionally, a SecurityManager ProtectionDomain can be specified for use by the ClassLoader when defining a class loaded from this entry in the repository. Not all loaders can add resources dynamically - that may require a reload.

addRepository

public void addRepository(java.net.URL url)
Add a new remote repository. Not all class loader will support remote resources, use File if it's a local resource.

setParentLoader

public void setParentLoader(java.lang.ClassLoader parent)
The parent loader - used to load tomcat classes. The Loader must delegate to it, instead of using the system loader

getParentLoader

public java.lang.ClassLoader getParentLoader()


Copyright © 2000 Apache Software Foundation. All Rights Reserved.