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
ConstructorDescriptionRestartClassLoader
(ClassLoader parent, URL[] urls) Create a newRestartClassLoader
instance.RestartClassLoader
(ClassLoader parent, URL[] urls, ClassLoaderFileRepository updatedFiles) Create a newRestartClassLoader
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>
findResource
(String name) getResource
(String name) getResources
(String name) boolean
isClassReloadable
(Class<?> classType) Class<?>
Class<?>
publicDefineClass
(String name, byte[] b, ProtectionDomain protectionDomain) Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, 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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
RestartClassLoader
Create a newRestartClassLoader
instance.- Parameters:
parent
- the parent classloaderurls
- the urls managed by the classloader
-
RestartClassLoader
Create a newRestartClassLoader
instance.- Parameters:
parent
- the parent classloaderupdatedFiles
- any files that have been updated since the JARs referenced in URLs were created.urls
- the urls managed by the classloader
-
-
Method Details
-
getResources
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
getResource
- Overrides:
getResource
in classClassLoader
-
findResource
- Overrides:
findResource
in classURLClassLoader
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findClass
- Overrides:
findClass
in classURLClassLoader
- Throws:
ClassNotFoundException
-
publicDefineClass
- Specified by:
publicDefineClass
in interfaceSmartClassLoader
-
getOriginalClassLoader
- Specified by:
getOriginalClassLoader
in interfaceSmartClassLoader
-
isClassReloadable
- Specified by:
isClassReloadable
in interfaceSmartClassLoader
-