Package edu.pdx.cs410J.reflect
Class LoggingClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
edu.pdx.cs410J.reflect.LoggingClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
This
ClassLoader prints out the name of every class
that it (or its parent) loads.-
Constructor Summary
ConstructorsConstructorDescriptionLoggingClassLoader(URL[] urls, ClassLoader parent) Creates aLoggingClassLoaderthat loads classes from a given array of URLs. -
Method Summary
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.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
-
LoggingClassLoader
Creates aLoggingClassLoaderthat loads classes from a given array of URLs. However, before this class loader attempts to load the class, it will delegate to its parent class loader.
-
-
Method Details
-
loadClass
Invoked as this class loader is loading a class- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
main
Main program that uses aLoggingClassLoaderto load the class with the given name from a given location.
-