mirror of https://github.com/halo-dev/halo
chore: keep the pluginWrapper bean for compatibility (#6271)
#### What type of PR is this? /area core /milestone 2.18.x #### What this PR does / why we need it: 为了平滑升级先保留 PluginWrapper 的 Bean #### Does this PR introduce a user-facing change? ```release-note None ```pull/6276/head
parent
ad66247872
commit
138d52e731
|
@ -1,8 +1,8 @@
|
|||
package run.halo.app.plugin;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.pf4j.Plugin;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
/**
|
||||
* This class will be extended by all plugins and serve as the common class between a plugin and
|
||||
|
@ -11,10 +11,11 @@ import org.springframework.lang.NonNull;
|
|||
* @author guqing
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Getter
|
||||
@Slf4j
|
||||
public class BasePlugin extends Plugin {
|
||||
|
||||
protected final PluginContext context;
|
||||
protected PluginContext context;
|
||||
|
||||
/**
|
||||
* Constructor a plugin with the given plugin context.
|
||||
|
@ -25,8 +26,6 @@ public class BasePlugin extends Plugin {
|
|||
this.context = pluginContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public PluginContext getContext() {
|
||||
return context;
|
||||
public BasePlugin() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ public class DefaultPluginApplicationContextFactory implements PluginApplication
|
|||
|
||||
sw.start("RegisterBeans");
|
||||
var beanFactory = context.getBeanFactory();
|
||||
beanFactory.registerSingleton("pluginWrapper", pluginWrapper);
|
||||
context.registerBean(AggregatedRouterFunction.class);
|
||||
|
||||
if (pluginWrapper.getPlugin() instanceof SpringPlugin springPlugin) {
|
||||
|
|
Loading…
Reference in New Issue