Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » tomcat » util » loader » [javadoc | source]
org.apache.tomcat.util.loader
public class: Repository [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.loader.Repository
A group of modules and libraries. Modules can have one or more jars and class dirs. Classloaders are created from modules when the module is started are be disposed when the module is stopped. The module will delegate to the associated repository in addition to the normal delegation rules. The repository will search on all sibling modules. This mechanism is defined in the MLetClassLoader and is also used by JBoss and few other servers. TODO: explain more ( or point to the right jboss/mlet pages ) TODO: explain how this can be used for webapps to support better partitioning
Constructor:
 public Repository(Loader loader) 
Method from org.apache.tomcat.util.loader.Repository Summary:
addClassLoader,   addModule,   checkReload,   findClass,   findResource,   getClassLoader,   getLoader,   getModules,   getName,   getParent,   isModified,   newModule,   removeClassLoader,   setName,   setParent,   setParentClassLoader,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.loader.Repository Detail:
  void addClassLoader(ClassLoader cl) 
    Add a class loder to the group. If this is a StandardClassLoader instance, it will be able to delegate to the group. If it's a regular ClassLoader - it'll be searched for classes, but it will not be able to delegate to peers. In future we may fine tune this by using manifests.
  void addModule(Module mod) 
 public  void checkReload() 
    Reload any module that is modified
 Class findClass(ClassLoader caller,
    String classN) 
    Find a class in the group. It'll iterate over each loader and try to find the class - using only the method that search locally or on parent ( i.e. not in group, to avoid recursivity ).
 URL findResource(ModuleClassLoader caller,
    String classN) 
 public ClassLoader getClassLoader() 
    Return a class loader associated with the group. This will delegate to all modules in the group, then to parent.
 public Loader getLoader() 
 public Enumeration getModules() 
 public String getName() 
 Repository getParent() 
 public boolean isModified() 
    Verify if any module is modified. This is a deep search, including dirs. Expensive operation.
 public  void newModule(String path) 
 public  void removeClassLoader(ClassLoader cl) 
 public  void setName(String name2) 
 public  void setParent(Repository parent) 
 public  void setParentClassLoader(ClassLoader myL) 
    Set the parent class loader - can be used instead of setParent, in case this is the top loader and needs to delagate to embedding app
 public String toString()