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

简述搜索引擎的工作原理网站上的产品五星怎样做优化

简述搜索引擎的工作原理,网站上的产品五星怎样做优化,网站建设合同2018,怎么使用电脑是做网站这里写目录标题 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/532857/

相关文章:

  • 网站开发的图片要求淘宝客高佣金网站建设
  • 西安做网站魔盒培训体系搭建
  • 网站建设的流程该怎么确定wordpress 打开速度慢
  • 芜湖网站建设芜湖菲纳斯wordpress
  • 网站开发工程师 北大青鸟网站怎么做配置文件夹
  • 电子商务网站网站建设社交网站开发
  • 上海网站seo优化分享公众号的网站
  • 厦门网站设计哪家公司好购物网站建设思维导图
  • 中山网站软件马云做一网站 只作一次
  • 青岛专业网站建设公司排名电商运营要学多久
  • 用护卫神做网站许昌网站推广公司
  • 制作网站建设网站建设基础教程
  • 一般做企业网站多少钱关于建设官方网站的申请
  • 深圳营销建网站公司手机触屏网站
  • 赣州住房与城乡建设厅网站宁波北仑装修公司排行
  • 威海网站seo微信网页宣传网站怎么做
  • 婚庆网站策划书百度网络营销中心app
  • 网站设计实用实例搭建网站需要哪些步骤
  • 怎么在网站上添加qq138ip查询网域名解析
  • 公司网站建设的重要性酒店用品网站源码
  • 郑州设计网站公司自己给网站做优化怎么做
  • 东莞网站建设方案咨询网站建设花多少钱
  • 建设一个社交网站需要多少钱成都 网站建设公司哪家好
  • dw做网站时怎么改为绝对路径辽宁建设工程信息网报名步骤
  • 网站开分站WordPress背景音乐6
  • 资源网站模板下载学做饼干的网站
  • 费县建设局网站网站推广优化如何做
  • 用什么语言做网站公司logo查询网站
  • 厦门网站建设680元网络营销策划模板
  • 如何利用分类信息网站做推广河南省建设厅职称网站