jmx客户端
In last tutorial we learned about JMX Basics and how can we use JConsole to manage MBeans. Today we will look into java jmx client example and role based authentication through config files.
在上一教程中,我们了解了JMX Basics,以及如何使用JConsole管理MBean 。 今天,我们将研究Java jmx客户端示例和通过配置文件进行的基于角色的身份验证。
Java JMX客户端 (Java JMX Client)
Although JConsole provides a graphical view but it requires human effort to work with MBean and not suitable where you want to invoke some features of MBean periodically. For example, you have a MBean that provides the current state of application and you want to invoke it to check the state every 10 minutes. In this case, having a java program that can work as JMX Client to connect to JMX MBean server and invoke MBean operations are very useful.
尽管JConsole提供了图形化视图,但是使用MBean需要人工操作,因此不适合您需要定期调用MBean的某些功能的地方。 例如,您有一个提供当前应用程序状态的MBean,并且您想调用它以每10分钟检查一次状态。 在这种情况下,拥有一个可用作JMX Client的Java程序以连接到JMX MBean服务器并调用MBean操作非常有用。
JMX客户端示例 (JMX Client Example)
Here we will write a java program that can connect to MBean server and create a proxy application to invoke MBean operations. I will use the MBean application created in JMX Tutorial and use our client program to connect to MBean. Later on we will check how to make our MBean server secure using JMX Configuration files for role based access and how we can use credentials in the JMX Client