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
ConstructorDescriptionLoggingClassLoader
(URL[] urls, ClassLoader parent) Creates aLoggingClassLoader
that 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, newInstance
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
Methods 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 aLoggingClassLoader
that 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:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
main
Main program that uses aLoggingClassLoader
to load the class with the given name from a given location.
-