
io.github.icodegarden.nursery.springboot.lifecycle.GracefullyShutdownLifecycle Maven / Gradle / Ivy
package io.github.icodegarden.nursery.springboot.lifecycle;
import org.springframework.context.SmartLifecycle;
import io.github.icodegarden.nutrient.lang.lifecycle.GracefullyShutdown;
/**
* 通常你需要 @Bean
* @author Fangfang.Xu
*
*/
public class GracefullyShutdownLifecycle implements SmartLifecycle {
private boolean running;
@Override
public void start() {
running = true;
}
@Override
public void stop() {
running = false;
GracefullyShutdown.Registry.singleton().shutdownRegistered();
}
@Override
public boolean isRunning() {
return running;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy