Tomcat通过JMX重新启动

编程入门 行业动态 更新时间:2024-10-26 06:26:42
本文介绍了Tomcat通过JMX重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以通过JMX重新启动tomcat? tomcat是否有任何支持重新启动其所有应用程序和服务的mbean?

Is it possible to restart tomcat via JMX? Does tomcat has any mbean that supports restart of all its apps and services?

推荐答案

据我所知,没有特定的功能可以执行此操作.但是,您可以安装一个自定义MBean,它将调用:

So far as I know, there is no specific functionality to do this. However, you can install a custom MBean which will call :

public static final int RESTART_EXIT_CODE = -999; .... java.lang.System.exit(RESTART_EXIT_CODE);

然后修改启动Tomcat服务的命令文件,以检查JVM进程的退出代码,如果它等于RESTART_EXIT_CODE,则重新调用该命令文件.

Then modify the command file that starts the Tomcat service to check the exit code of the JVM process, and if it is equal to the RESTART_EXIT_CODE, then re-invoke the command file.

更多推荐

Tomcat通过JMX重新启动

本文发布于:2023-11-25 12:25:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629740.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重新启动   Tomcat   JMX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!