Class BshClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
bsh.classpath.BshClassLoader
- All Implemented Interfaces:
Closeable, AutoCloseable
- Direct Known Subclasses:
DiscreteFilesClassLoader
One of the things BshClassLoader does is to address a deficiency in
URLClassLoader that prevents us from specifying individual classes
via URLs.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBshClassLoader(BshClassManager classManager) For use by childrenBshClassLoader(BshClassManager classManager, BshClassPath bcp) BshClassLoader(BshClassManager classManager, URL[] bases) -
Method Summary
Methods inherited from class URLClassLoader
close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class SecureClassLoader
defineClass, defineClassMethods inherited from class ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
BshClassLoader
- Parameters:
bases- URLs JARClassLoader seems to require absolute paths
-
BshClassLoader
- Parameters:
bcp- BshClassPath from which we'll take our base URLs
-
BshClassLoader
For use by children
-
-
Method Details
-
addURL
- Overrides:
addURLin classURLClassLoader
-
loadClass
This modification allows us to reload classes which are in the Java VM user classpath. We search first rather than delegate to the parent classloader (or bootstrap path) first. An exception is for BeanShell core classes which are always loaded from the same classloader as the interpreter.- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
findClass
Find the correct source for the class... Try designated loader if any Try our URLClassLoader paths if any Try base loader if any Try system ???- Overrides:
findClassin classURLClassLoader- Throws:
ClassNotFoundException
-