Destiny.Lin
6 months ago
6 changed files with 55 additions and 86 deletions
@ -1,63 +0,0 @@ |
|||||||
package com.fr.design.extra; |
|
||||||
|
|
||||||
|
|
||||||
import com.fanruan.carina.Carina; |
|
||||||
import com.fanruan.plugin.design.loader.PluginResourceLoaderSingletonShell; |
|
||||||
import com.fanruan.plugin.design.loader.UPMResourceLoaderSingletonShell; |
|
||||||
import com.fanruan.plugin.design.store.PluginStoreProvider; |
|
||||||
import com.fanruan.plugin.design.store.PluginStoreSingletonShell; |
|
||||||
import com.fr.decision.webservice.v10.plugin.helper.category.ResourceLoader; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 用于设计器调用插件内部资源 |
|
||||||
* <p>对应的资源需要提前注册进环境里</p> |
|
||||||
* |
|
||||||
* @author Destiny.Lin |
|
||||||
* @since 11.0 |
|
||||||
* Created on 2024/5/14 |
|
||||||
*/ |
|
||||||
public class PluginHelper { |
|
||||||
private PluginStoreProvider storeProvider; |
|
||||||
private ResourceLoader upmLoader; |
|
||||||
private ResourceLoader pluginLoader; |
|
||||||
private static final PluginHelper INSTANCE = new PluginHelper(); |
|
||||||
|
|
||||||
private PluginHelper() { |
|
||||||
storeProvider = Carina.getApplicationContext().singleton(PluginStoreSingletonShell.class).get(); |
|
||||||
upmLoader = Carina.getApplicationContext().singleton(UPMResourceLoaderSingletonShell.class).get(); |
|
||||||
pluginLoader = Carina.getApplicationContext().singleton(PluginResourceLoaderSingletonShell.class).get(); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取插件helper单例 |
|
||||||
*/ |
|
||||||
public static PluginHelper getInstance() { |
|
||||||
return INSTANCE; |
|
||||||
} |
|
||||||
|
|
||||||
public PluginStoreProvider getStoreProvider() { |
|
||||||
return storeProvider; |
|
||||||
} |
|
||||||
|
|
||||||
public void setStoreProvider(PluginStoreProvider storeProvider) { |
|
||||||
this.storeProvider = storeProvider; |
|
||||||
} |
|
||||||
|
|
||||||
public ResourceLoader getUpmLoader() { |
|
||||||
return upmLoader; |
|
||||||
} |
|
||||||
|
|
||||||
public void setUpmLoader(ResourceLoader upmLoader) { |
|
||||||
this.upmLoader = upmLoader; |
|
||||||
} |
|
||||||
|
|
||||||
public ResourceLoader getPluginLoader() { |
|
||||||
return pluginLoader; |
|
||||||
} |
|
||||||
|
|
||||||
public void setPluginLoader(ResourceLoader pluginLoader) { |
|
||||||
this.pluginLoader = pluginLoader; |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,32 @@ |
|||||||
|
package com.fanruan.boot; |
||||||
|
|
||||||
|
import com.fanruan.carina.annotions.DependsOn; |
||||||
|
import com.fanruan.carina.annotions.FineComponent; |
||||||
|
import com.fanruan.carina.annotions.Start; |
||||||
|
|
||||||
|
import javax.servlet.ServletContext; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设计器插件模块 |
||||||
|
* |
||||||
|
* @author Destiny.Lin |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2024/5/17 |
||||||
|
*/ |
||||||
|
@FineComponent(name = "design_plugin") |
||||||
|
@DependsOn(dependencies = {"design_core_supplemental", "design_dao", "design_conf_config", "design_logger"}) |
||||||
|
public class DesignPluginComponent extends PluginComponent{ |
||||||
|
|
||||||
|
/** |
||||||
|
* start |
||||||
|
*/ |
||||||
|
@Start |
||||||
|
public void start() { |
||||||
|
super.start(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void addPluginStoreFilter(ServletContext servletContext) { |
||||||
|
// do nothing
|
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue