Tomcat通过JMX重新启动 [英] tomcat restart via JMX

查看:95
本文介绍了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重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆