use ClassLoaderLeakPreventor to reduce ClassLoaderLeaks of plugins

This commit is contained in:
Sebastian Sdorra
2019-06-19 11:52:20 +02:00
parent 6cee35a9f1
commit 91fd259f07
12 changed files with 341 additions and 56 deletions

View File

@@ -41,6 +41,7 @@ import com.google.common.io.Files;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.boot.ClassLoaderLifeCycle;
import sonia.scm.util.IOUtil;
//~--- JDK imports ------------------------------------------------------------
@@ -86,13 +87,13 @@ public final class PluginsInternal
*
* @throws IOException
*/
public static Set<PluginWrapper> collectPlugins(ClassLoader classLoader,
Path directory)
public static Set<PluginWrapper> collectPlugins(ClassLoaderLifeCycle classLoaderLifeCycle,
Path directory)
throws IOException
{
PluginProcessor processor = new PluginProcessor(directory);
PluginProcessor processor = new PluginProcessor(classLoaderLifeCycle, directory);
return processor.collectPlugins(classLoader);
return processor.collectPlugins(classLoaderLifeCycle.getBootstrapClassLoader());
}
/**