Class RestartClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.springframework.boot.devtools.restart.classloader.RestartClassLoader
- All Implemented Interfaces:
Closeable, AutoCloseable, SmartClassLoader
Disposable
ClassLoader used to support application restarting. Provides parent
last loading for the specified URLs.- Since:
- 1.3.0
- Author:
- Andy Clement, Phillip Webb
-
Constructor Summary
ConstructorsConstructorDescriptionRestartClassLoader(ClassLoader parent, URL[] urls) Create a newRestartClassLoaderinstance.RestartClassLoader(ClassLoader parent, URL[] urls, ClassLoaderFileRepository updatedFiles) Create a newRestartClassLoaderinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?> @Nullable URLfindResource(String name) @Nullable URLgetResource(String name) getResources(String name) booleanisClassReloadable(Class<?> classType) Class<?> Class<?> publicDefineClass(String name, byte[] b, @Nullable ProtectionDomain protectionDomain) Methods inherited from class URLClassLoader
addURL, close, definePackage, 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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
RestartClassLoader
Create a newRestartClassLoaderinstance.- Parameters:
parent- the parent classloaderurls- the urls managed by the classloader
-
RestartClassLoader
Create a newRestartClassLoaderinstance.- Parameters:
parent- the parent classloaderurls- the urls managed by the classloaderupdatedFiles- any files that have been updated since the JARs referenced in URLs were created.
-
-
Method Details
-
getResources
- Overrides:
getResourcesin classClassLoader- Throws:
IOException
-
getResource
- Overrides:
getResourcein classClassLoader
-
findResource
- Overrides:
findResourcein classURLClassLoader
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
findClass
- Overrides:
findClassin classURLClassLoader- Throws:
ClassNotFoundException
-
publicDefineClass
public Class<?> publicDefineClass(String name, byte[] b, @Nullable ProtectionDomain protectionDomain) - Specified by:
publicDefineClassin interfaceSmartClassLoader
-
getOriginalClassLoader
- Specified by:
getOriginalClassLoaderin interfaceSmartClassLoader
-
isClassReloadable
- Specified by:
isClassReloadablein interfaceSmartClassLoader
-