当前位置: 首页 > news >正文

保定市网站制作wordpress 去掉顶部工具栏

保定市网站制作,wordpress 去掉顶部工具栏,广告公司起名字大全,企业网站推广策划方法这里写目录标题 1 介绍2 使用2.1 开启 hook2.2 禁用 hook 3 手动指定 hook 1 介绍 SpringBoot 如果需要使用hook则需要开启spring.main.register-shutdown-hooktrue(默认为true) 如果使用kill -9则不会出发JVM的hook,kill可以正常触发hook server:port: 8080shutd…

这里写目录标题

  • 1 介绍
  • 2 使用
    • 2.1 开启 hook
    • 2.2 禁用 hook
  • 3 手动指定 hook

1 介绍

SpringBoot 如果需要使用hook则需要开启spring.main.register-shutdown-hook=true(默认为true)
如果使用kill -9则不会出发JVM的hook,kill可以正常触发hook

server:port: 8080shutdown: IMMEDIATE #GRACEFUL/IMMEDIATE (默认IMMEDIATE)spring:main:register-shutdown-hook: true #默认ture

2 使用

package com.example.java.test;import jakarta.annotation.PreDestroy;
import org.springframework.stereotype.Component;/*** @author hyacinth* @date 2023/10/13 23:07* @desc: 测试* @title: Test* @package com.example.java.test*/
@Component
public class Test {@PreDestroypublic void destroy() {System.out.println("销毁");}public Test() {System.out.println("创建");}}

2.1 开启 hook

如果spring.main.register-shutdown-hook=true

  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::                (v3.1.4)2023-10-13T23:11:26.801+08:00  INFO 18244 --- [  restartedMain] com.example.java.JavaApplication         : Starting JavaApplication using Java 21 with PID 18244 (D:\SourceCode\Intellij\java\target\classes started by xuhya in D:\SourceCode\Intellij\java)
2023-10-13T23:11:26.805+08:00  INFO 18244 --- [  restartedMain] com.example.java.JavaApplication         : No active profile set, falling back to 1 default profile: "default"
2023-10-13T23:11:26.916+08:00  INFO 18244 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-10-13T23:11:26.916+08:00  INFO 18244 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-10-13T23:11:28.594+08:00  INFO 18244 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-10-13T23:11:28.622+08:00  INFO 18244 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-10-13T23:11:28.623+08:00  INFO 18244 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.13]
2023-10-13T23:11:28.696+08:00  INFO 18244 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-10-13T23:11:28.697+08:00  INFO 18244 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1779 ms
创建
2023-10-13T23:11:29.308+08:00  INFO 18244 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2023-10-13T23:11:29.386+08:00  INFO 18244 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-10-13T23:11:29.403+08:00  INFO 18244 --- [  restartedMain] com.example.java.JavaApplication         : Started JavaApplication in 3.274 seconds (process running for 3.915)
销毁Process finished with exit code 130

2.2 禁用 hook

如果spring.main.register-shutdown-hook=false

如果spring.main.register-shutdown-hook=true```java.   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::                (v3.1.4)2023-10-13T23:11:26.801+08:00  INFO 18244 --- [  restartedMain] com.example.java.JavaApplication         : Starting JavaApplication using Java 21 with PID 18244 (D:\SourceCode\Intellij\java\target\classes started by xuhya in D:\SourceCode\Intellij\java)
2023-10-13T23:11:26.805+08:00  INFO 18244 --- [  restartedMain] com.example.java.JavaApplication         : No active profile set, falling back to 1 default profile: "default"
2023-10-13T23:11:26.916+08:00  INFO 18244 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-10-13T23:11:26.916+08:00  INFO 18244 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-10-13T23:11:28.594+08:00  INFO 18244 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-10-13T23:11:28.622+08:00  INFO 18244 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-10-13T23:11:28.623+08:00  INFO 18244 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.13]
2023-10-13T23:11:28.696+08:00  INFO 18244 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-10-13T23:11:28.697+08:00  INFO 18244 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1779 ms
创建
2023-10-13T23:11:29.308+08:00  INFO 18244 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2023-10-13T23:11:29.386+08:00  INFO 18244 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-10-13T23:11:29.403+08:00  INFO 18244 --- [  restartedMain] com.example.java.JavaApplication         : Started JavaApplication in 3.274 seconds (process running for 3.915)Process finished with exit code 130

3 手动指定 hook

package com.example.java;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class JavaApplication {public static void main(String[] args) {SpringApplication.run(JavaApplication.class, args);Runtime.getRuntime().addShutdownHook(new Thread(() -> {System.out.println("服务已停止");}));}}
  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::                (v3.1.4)2023-10-13T23:15:08.667+08:00  INFO 16108 --- [  restartedMain] com.example.java.JavaApplication         : Starting JavaApplication using Java 21 with PID 16108 (D:\SourceCode\Intellij\java\target\classes started by xuhya in D:\SourceCode\Intellij\java)
2023-10-13T23:15:08.671+08:00  INFO 16108 --- [  restartedMain] com.example.java.JavaApplication         : No active profile set, falling back to 1 default profile: "default"
2023-10-13T23:15:08.752+08:00  INFO 16108 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-10-13T23:15:08.752+08:00  INFO 16108 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-10-13T23:15:10.314+08:00  INFO 16108 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-10-13T23:15:10.335+08:00  INFO 16108 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-10-13T23:15:10.335+08:00  INFO 16108 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.13]
2023-10-13T23:15:10.402+08:00  INFO 16108 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-10-13T23:15:10.403+08:00  INFO 16108 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1649 ms
创建
2023-10-13T23:15:10.914+08:00  INFO 16108 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2023-10-13T23:15:10.996+08:00  INFO 16108 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-10-13T23:15:11.015+08:00  INFO 16108 --- [  restartedMain] com.example.java.JavaApplication         : Started JavaApplication in 3.038 seconds (process running for 3.626)
服务已停止
http://www.yayakq.cn/news/892712/

相关文章:

  • 如何做网站建设西安网站建设网络
  • 济南手机端建站模板建电影网站
  • 做创意美食的视频网站创意广告牌设计图片大全
  • 奥联网络网站建设注册网站建设
  • 商丘做网站张郑州市住房和城乡建设厅网站
  • 阿里云腾讯云网站建设沧州网络运营公司
  • 建网站需要了解什么平台开发是做什么的
  • wordpress如何配置伪静态页面网站建设布局利于优化
  • 网站设计的收费高米店网站建设公司
  • 做打鱼网站的代理苏州实力做网站公司有哪些
  • 海南建设大厅网站杭州外贸网站多少钱
  • 石家庄免费建站模板网站建设网站维护网站外包
  • 做去自己的网站石家庄建设南大街小学网站
  • 网站问题图片爱站网 关键词挖掘工具站
  • 做网站中山贴吧 wordpress
  • 网站建设推广公司哪家好做的时间长的网站制作公司
  • 网站开发工程师ppt做网站报价明细表
  • 怎样做销售产品网站温州建设小学的网站
  • 开发手机网站用什么好处网站修改后怎么上传
  • 南宁建设职业技术学院招聘信息网站如何用记事本做网站
  • 教育网站模板下载wordpress 建站 教程视频
  • 企业商城建站简单的招聘网站怎么做
  • 班级网站制作建设的设计和作用国际新闻最新消息十条
  • 关键词库在网站上怎么体现兰州网站排名优化公司
  • 市场营销网站网站开发工程师需要什么技术
  • 互联网App网站建设方案网站建设合同定义
  • 白云网站 建设seo信科网站建设 台州
  • 住房城乡与建设厅网站首页网页设计实验报告课程建议
  • 成都前几年网站建设公司做网站有那几种末班
  • 回收网站怎么做深圳网页设计师公司