public class PluginClassLoader extends URLClassLoader
Constructor and Description |
---|
PluginClassLoader(URL[] urls,
ClassLoader parent)
PluginClassLoader is exetend form URLClassLoader , and the constructor
has not overide the super constroctor , but has done some stuff to find out
jar fils inside /lib director
|
Modifier and Type | Method and Description |
---|---|
protected Class |
findClass(String name) |
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public PluginClassLoader(URL[] urls, ClassLoader parent)
urls
- URL
parent
- parent classloader ClassLoader
protected Class findClass(String name) throws ClassNotFoundException
findClass
in class URLClassLoader
name
- String
Name of the file to be loadedClass
return a class object if it found else
will return null or a ClassNotFoundException
This method has been overridden in the following way
1. It calls the super class and checks to see whether the class is there
If the class is found then return it, else if super return ClassNotfoundException
2. Check whether the entry corresponding to the class name exists in one of jar files
in /lib director
3. If it is there get the byte array out of that and create a Class object out of that
by calling "defineClass()" , if it succeeds then return that else
4. Throw a ClassNotFoundExceptionClassNotFoundException
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.