Skip to content

Commit

Permalink
refactor: plugin classloader config
Browse files Browse the repository at this point in the history
  • Loading branch information
guqing committed Sep 27, 2023
1 parent f7ccb65 commit a815db0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 58 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.pf4j.DevelopmentPluginLoader;
import org.pf4j.JarPluginLoader;
import org.pf4j.JarPluginRepository;
import org.pf4j.PluginClassLoader;
import org.pf4j.PluginDescriptor;
import org.pf4j.PluginLoader;
import org.pf4j.PluginManager;
Expand Down Expand Up @@ -110,17 +109,7 @@ protected PluginLoader createPluginLoader() {
} else {
return new CompoundPluginLoader()
.add(createDevelopmentPluginLoader(this), this::isDevelopment)
.add(new JarPluginLoader(this) {
@Override
public ClassLoader loadPlugin(Path pluginPath,
PluginDescriptor pluginDescriptor) {
PluginClassLoader pluginClassLoader =
new DefaultPluginClassLoader(pluginManager,
pluginDescriptor, getClass().getClassLoader());
pluginClassLoader.addFile(pluginPath.toFile());
return pluginClassLoader;
}
});
.add(new JarPluginLoader(this));
}
}

Expand Down Expand Up @@ -155,12 +144,6 @@ protected PluginRepository createPluginRepository() {

DevelopmentPluginLoader createDevelopmentPluginLoader(PluginManager pluginManager) {
return new DevelopmentPluginLoader(pluginManager) {
@Override
protected PluginClassLoader createPluginClassLoader(Path pluginPath,
PluginDescriptor pluginDescriptor) {
return new DefaultPluginClassLoader(pluginManager,
pluginDescriptor, getClass().getClassLoader());
}

@Override
public ClassLoader loadPlugin(Path pluginPath,
Expand Down

0 comments on commit a815db0

Please sign in to comment.