mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 22:27:33 +00:00
[Change] Core 为 FrameworkManager 内的 DevelopmentPluginLoader 补充对类加载策略的设置;
[Change] FrameworkManager 为 DevelopmentPluginLoader 重写 'createPluginClassLoader' 方法, 以提供 ClassLoadingStrategy 策略;
This commit is contained in:
parent
cd5c813b70
commit
039a686f90
@ -22,6 +22,7 @@ import net.lamgc.cgj.bot.event.EventExecutor;
|
|||||||
import org.pf4j.*;
|
import org.pf4j.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 框架管理器.
|
* 框架管理器.
|
||||||
@ -43,7 +44,13 @@ public class FrameworkManager extends JarPluginManager {
|
|||||||
@Override
|
@Override
|
||||||
protected PluginLoader createPluginLoader() {
|
protected PluginLoader createPluginLoader() {
|
||||||
return new CompoundPluginLoader()
|
return new CompoundPluginLoader()
|
||||||
.add(new DevelopmentPluginLoader(this), this::isDevelopment)
|
.add(new DevelopmentPluginLoader(this) {
|
||||||
|
@Override
|
||||||
|
protected PluginClassLoader createPluginClassLoader(Path pluginPath, PluginDescriptor pluginDescriptor) {
|
||||||
|
return new PluginClassLoader(FrameworkManager.this, pluginDescriptor,
|
||||||
|
getClass().getClassLoader(), ClassLoadingStrategy.ADP);
|
||||||
|
}
|
||||||
|
}, this::isDevelopment)
|
||||||
.add(new JarFrameworkLoader(this), this::isNotDevelopment);
|
.add(new JarFrameworkLoader(this), this::isNotDevelopment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user