
org.pf4j.spring.boot.hooks.Pf4jShutdownHook Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pf4j2-spring-boot-starter Show documentation
Show all versions of pf4j2-spring-boot-starter Show documentation
Spring Boot Starter For Pf4j 2.x
The newest version!
package org.pf4j.spring.boot.hooks;
import org.pf4j.PluginManager;
public class Pf4jShutdownHook extends Thread {
private PluginManager pluginManager;
public Pf4jShutdownHook(PluginManager pluginManager) {
this.pluginManager = pluginManager;
}
@Override
public void run() {
// 销毁插件
if (pluginManager != null) {
/*
* 调用Plugin实现类的stop()方法
*/
pluginManager.stopPlugins();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy