com.aelitis.azureus.launcher.classloading
Class PrimaryClassloader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by com.aelitis.azureus.launcher.classloading.PrimaryClassloader
All Implemented Interfaces:
PeeringClassloader

public class PrimaryClassloader
extends URLClassLoader
implements PeeringClassloader

Author:
Aaron Grunthal

Constructor Summary
PrimaryClassloader(ClassLoader parent)
          Deprecated. DO NOT INVOKE MANUALLY
 
Method Summary
static ClassLoader getBootstrappedLoader()
           
protected  Class loadClass(String name, boolean resolve)
          altered class lookup follow normal delegation, circumventing the system classloader as we bootstraped it away OR delegate to the system classloader iff it is for classes from this package, this allows us to rebootstrap and discard other branches in the hierarchy check for loaded by peers try to load from peers
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimaryClassloader

public PrimaryClassloader(ClassLoader parent)
Deprecated. DO NOT INVOKE MANUALLY

initialization path when loaded via -Djava.system.class.loader=com.aelitis.azureus.launcher.classloading.PrimaryClassloader instead of bootstrapping, has the advantage that this gets registered as system classloader

Method Detail

loadClass

protected Class loadClass(String name,
                          boolean resolve)
                   throws ClassNotFoundException
altered class lookup
  1. follow normal delegation, circumventing the system classloader as we bootstraped it away
  2. OR delegate to the system classloader iff it is for classes from this package, this allows us to rebootstrap and discard other branches in the hierarchy
  3. check for loaded by peers
  4. try to load from peers

Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

getBootstrappedLoader

public static ClassLoader getBootstrappedLoader()
Parameters:
toRun -