make ClassLoaderLeakPreventorFactory configurable and mark BootstrapClassLoader as shutdown

This commit is contained in:
Sebastian Sdorra
2019-11-21 16:16:15 +01:00
parent c944f23447
commit ff7b8ca842
3 changed files with 111 additions and 15 deletions

View File

@@ -5,7 +5,29 @@ package sonia.scm.lifecycle.classloading;
* find it in a heap dump.
*/
class BootstrapClassLoader extends ClassLoader {
/**
* Marker to find a BootstrapClassLoader, which is already shutdown.
*/
private boolean shutdown = false;
BootstrapClassLoader(ClassLoader webappClassLoader) {
super(webappClassLoader);
}
/**
* Returns {@code true} if the classloader was shutdown.
*
* @return {@code true} if the classloader was shutdown
*/
boolean isShutdown() {
return shutdown;
}
/**
* Mark the class loader as shutdown.
*/
void markAsShutdown() {
shutdown = true;
}
}