简体   繁体   English

JMX使用Jetty作为嵌入式服务器启用我的应用程序

[英]JMX enabling my Application using Jetty as embedded server

I have a java server application that would like to provide Http interface to for administrative tasks such as monitoring and configuring it at run-time and such. 我有一个java服务器应用程序,希望为管理任务提供Http接口,例如在运行时监视和配置它等。

I have some idea that JMX would provide me with a neat standard interface that if I implement, I would provide a nice standard management interface that ALL types of management console applications can use to administor my Server application. 我有点认为JMX会为我提供一个简洁的标准接口,如果我实现,我会提供一个很好的标准管理接口,所有类型的管理控制台应用程序都可以使用它来管理我的服务器应用程序。

I am wondering if Jetty has a part to play in all of this running in-process (embedded) into my java application? 我想知道Jetty是否有一部分可以在我的java应用程序中运行进程(嵌入式)?

what do you think is a best way of managing/monitoring my java application using a web interface? 您认为使用Web界面管理/监控我的Java应用程序的最佳方式是什么?

Appreciate your help 感谢您的帮助

We added a jmx rest interface option in jetty some time ago that might be useful here. 我们前一段时间在jetty中添加了一个jmx rest接口选项,这在这里可能很有用。

http://webtide.intalio.com/2011/05/jetty-jmx-webservice/ http://webtide.intalio.com/2011/05/jetty-jmx-webservice/

It could easily be pulled from for an admin like interface for management or presentation purposes. 对于管理或演示目的,它可以很容易地从管理员界面中拉出来。

JMX would allow you to expose configuration points for your application. JMX允许您公开应用程序的配置点。 This is required if you desire a programmatic/automated way of configuring your application. 如果您需要以编程/自动方式配置应用程序,则需要这样做。 Using JMX to configure application is not desirable for a naive users. 对于天真的用户来说,使用JMX配置应用程序是不可取的。 It is not very likely that they would know how to use JMX. 他们不太可能知道如何使用JMX。 Instead a graphical console would appeal to them. 相反,图形控制台会吸引他们。 They can simply see what they need to configure, refer any reference material or help and just do it. 他们可以简单地看到他们需要配置什么,参考任何参考资料或帮助,然后就可以了。

It is desirable that you have both the options; 你有两个选择是可取的; a web console and also the JMX way for programmatic access. Web控制台以及用于编程访问的JMX方式。

Secondly, you dont need a any third party server to JMX-enable your application. 其次,您不需要任何第三方服务器来启用JMX应用程序。 You simply create an instance of MBeanServer and it will host your mbeans. 您只需创建一个MBeanServer实例,它将托管您的mbeans。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM