|
|
@ -4,6 +4,7 @@ import org.apache.catalina.connector.Connector; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|
|
|
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; |
|
|
|
import org.springframework.context.ApplicationListener; |
|
|
@ -16,6 +17,7 @@ import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
@EnableConfigurationProperties(ShutdownProperties.class) |
|
|
|
@Component |
|
|
|
@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enable", havingValue = "true", matchIfMissing = false) |
|
|
|
public class GracefulShutdownTomcat implements TomcatConnectorCustomizer, ApplicationListener<ContextClosedEvent> { |
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(GracefulShutdownTomcat.class); |
|
|
|