public interface PluginOperator
DefaultPluginOperator| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
backupPlugin(Path path,
String sign)
通过路径备份文件。
|
boolean |
backupPlugin(String pluginId,
String sign)
通过插件id备份插件。
|
Set<String> |
getPluginFilePaths()
得到插件文件的路径 [适用于生产环境]
|
List<PluginInfo> |
getPluginInfo()
获取插件信息 [适用于生产环境、开发环境]
|
PluginInfo |
getPluginInfo(String pluginId)
根据插件id获取插件信息 [适用于生产环境、开发环境]
|
List<org.pf4j.PluginWrapper> |
getPluginWrapper()
得到所有插件的包装类 [适用于生产环境、开发环境]
|
org.pf4j.PluginWrapper |
getPluginWrapper(String pluginId)
通过插件id得到插件的包装类 [适用于生产环境、开发环境]
|
boolean |
initPlugins(PluginInitializerListener pluginInitializerListener)
初始化插件。
|
boolean |
install(Path path)
通过路径安装插件(会启用), 该插件文件必须存在于服务器 [适用于生产环境]
如果在插件目录存在同名的插件包, 系统会自动备份该插件包。
|
boolean |
installConfigFile(Path path)
通过路径安装插件的配置文件。
|
boolean |
start(String pluginId)
启用插件 [适用于生产环境、开发环境]
|
boolean |
stop(String pluginId)
停止插件 [适用于生产环境、开发环境]
|
boolean |
uninstall(String pluginId,
boolean isBackup)
卸载插件 [适用于生产环境]
|
boolean |
uploadConfigFile(org.springframework.web.multipart.MultipartFile configFile)
上传配置文件。
|
boolean |
uploadPluginAndStart(org.springframework.web.multipart.MultipartFile pluginFile)
上传插件并启用插件。
|
boolean initPlugins(PluginInitializerListener pluginInitializerListener) throws Exception
pluginInitializerListener - 插件初始化监听者Exception - 异常信息boolean install(Path path) throws Exception
path - 插件路径Exception - 异常信息boolean uninstall(String pluginId, boolean isBackup) throws Exception
pluginId - 插件idisBackup - 是否备份原来的插件。备份文件命名规则为;[uninstall][时间]_原jar名.jarException - 异常信息boolean start(String pluginId) throws Exception
pluginId - 插件idException - 异常信息boolean stop(String pluginId) throws Exception
pluginId - 插件idException - 异常信息boolean uploadPluginAndStart(org.springframework.web.multipart.MultipartFile pluginFile)
throws Exception
pluginFile - 配置文件Exception - 异常信息boolean installConfigFile(Path path) throws Exception
path - 配置文件路径。Exception - 安装异常boolean uploadConfigFile(org.springframework.web.multipart.MultipartFile configFile)
throws Exception
configFile - 配置文件Exception - 异常信息boolean backupPlugin(Path path, String sign) throws Exception
path - 路径sign - 备份文件的自定义标识Exception - 异常信息boolean backupPlugin(String pluginId, String sign) throws Exception
pluginId - 插件idsign - 备份文件的自定义标识Exception - 异常信息List<PluginInfo> getPluginInfo()
PluginInfo getPluginInfo(String pluginId)
pluginId - 插件idSet<String> getPluginFilePaths() throws Exception
Exception - 异常信息List<org.pf4j.PluginWrapper> getPluginWrapper()
org.pf4j.PluginWrapper getPluginWrapper(String pluginId)
pluginId - 插件idCopyright © 2019. All rights reserved.