增加afterbladestop方法
This commit is contained in:
parent
32903b6622
commit
db0efd8a52
|
|
@ -86,4 +86,11 @@ public class WebConfig implements IConfig {
|
|||
System.out.println(DateKit.getMsTime() + " after blade start, you can do something~~~~~~~~~~~~~~~~");
|
||||
}
|
||||
|
||||
/**
|
||||
* 工程关闭执行逻辑
|
||||
*/
|
||||
public void afterBladeStop() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,9 @@ public interface IConfig {
|
|||
*/
|
||||
void afterBladeStart();
|
||||
|
||||
/**
|
||||
* 程序关闭之后执行
|
||||
*/
|
||||
void afterBladeStop();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import org.springframework.context.ApplicationListener;
|
|||
import org.springframework.context.event.ContextClosedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.smallchill.core.config.BladeConfig;
|
||||
import com.smallchill.core.plugins.PluginManager;
|
||||
|
||||
/**
|
||||
|
|
@ -31,6 +32,7 @@ public class StopListener implements ApplicationListener<ContextClosedEvent> {
|
|||
public void onApplicationEvent(ContextClosedEvent event) {
|
||||
if (event.getApplicationContext().getParent() == null) {
|
||||
destroyPlugin();
|
||||
afterBladeStop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -40,5 +42,12 @@ public class StopListener implements ApplicationListener<ContextClosedEvent> {
|
|||
private void destroyPlugin() {
|
||||
PluginManager.init().stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统关闭后执行
|
||||
*/
|
||||
private void afterBladeStop(){
|
||||
BladeConfig.getConf().afterBladeStop();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user