JMX介紹

JMX之(Introduction)

        
本文轉自http://www.blogjava.net/joseph/archive/2007/12/12/167241.html             

Introduction to JMX Technology

JMX technology provides a simple, standard way of managing resources such as applications, devices, and services. Because JMX technology is dynamic, you can use it to monitor and manage resources as they are created, installed and implemented. You can also use JMX technology to monitor and manage the Java Virtual Machine1 (Java VM).



    JMX技術提供一個簡單,標準的方式管理應用程序,設備和服務等資源,一旦這些資源被創建,安裝和實現,你能利用JMX的動態特性來監控和管理它們。同時你也可以用JMX來監控和管理JVM
JMX技術基於以下兩個JSR開發:
  * JSR 3, Java Management Extensions Instrumentation and Agent Specification
  * JSR 160, Java Management Extensions Remote API



What Is JMX Technology?

The JMX specification defines an architecture, the design patterns, the APIs, and the services for
application and network management and monitoring in the Java programming language.

Using JMX technology, a given resource is instrumented by one or more Java objects known as Managed Beans,
or MBeans. These MBeans are registered in a core managed object server, known as an MBean server, that acts as a management agent and can run on most devices enabled for the Java programming language.



    JMX規範,定義了一個架構、設計模式、APIs和服務,爲應用程序和網絡提供管理和監控。

    使用JMX,一個給定的資源,如可管理的Beans或者MBeans,可以被一個或者更多個Java對象操作。這些MBeans註冊在一個核心的管理對象 的Server上。如MBean Server,它當作一個管理的agent,能運行在大部分可用Java激活的設備上。

The specifications define JMX agents that you use to manage resources instrumented in compliance with the
specifications. A JMX agent consists of an MBean server, in which MBeans are registered, and a set of
services for handling MBeans. In this way, JMX agents directly control resources and make them available to remote management applications.

The way in which resources are instrumented is completely independent from the management infrastructure.
Resources can therefore be rendered manageable regardless of how their management applications are
implemented.

JMX technology defines standard connectors (JMX connectors) that allow you to access JMX agents from remote management applications. JMX connectors using different protocols provide the same management interface.
Hence a management application can manage resources transparently, regardless of the communication protocol used. JMX agents can also be used by systems or applications that are not compliant with the JMX
specification but which support JMX agents.



    使用JMX agents管理資源操作必須依照規範。一個JMX agent有一個MBean Server組成,這個MBean Server,提供給MBeans 註冊和一些列操作Mbeans服務,這樣JMX agents直接控制資源,使得能遠程控制應用程序。

    這種方式能使得被操作的資源能徹底的獨立於管理的底層結構,不產生任何依賴。資源可以不關心它們的管理程序如何實現。

    JMX技術定義了標準的connectors(JMX connectors),使你能遠程訪問JMX agents,JMX使用不同的協議提供相同的管理接口,所以管理程序可以透明的管理資源,不用考慮使用哪種通訊協議。JMX agents也可用於支持JMX agents但與JMX規範不一致的系統和應用。

下面的圖片可以看出大概結構:







Why Use JMX Technology?

JMX technology provides Java developers across all industries with a flexible means to instrument Java code,
 create smart Java agents, implement distributed management middleware and managers, and smoothly integrate these solutions into existing management and monitoring systems.


JMX技術能提供給所有工業行業的Java開發者一個靈活的mbeans去操作Java代碼,創建靈活的Java代理,實現分佈式的管理中間件和管理,而且能平穩的集成到已經存在的管理和監控系統中去。

1.  JMX technology enables Java applications to be managed without heavy investment: A JMX technology agent
 can run on most Java technology-enabled devices, thus Java applications can become manageable with little
impact on their design. A Java application simply needs to embed a managed object server and make some of
its functionality available as one or several managed beans (MBeans) registered in the object server; that
is all it takes to benefit from the management infrastructure.


JMX使得Java應用可被管理只需要很少的投入:
一個JMX agent能運行在大部分Java激活的設備上,因此Java應用是否可被管理與原來的設計基本沒有衝突。Java應用只需要簡單的嵌入一個管理對象的 Server,並在其上註冊一個或多個管理Beans(MBeans)在Server上,使Server上一些功能可用。這就是從管理的基層結構獲得的益 處。

2.  JMX technology provides a standard way to manage Java technology-based applications, systems, and
networks. For example, the Java Platform, Enterprise Edition (Java EE) 5 Application Server conforms to the JMX architecture and consequently can be managed using JMX technology.


JMX提供一個標準的方式管理Java編寫的應用,系統和網絡,例如:JavaEE 5的應用服務器遵循JMX架構,因此可以使用JMX技術管理。

3 . JMX technology can be used for out-of-the-box management of the Java VM. The Java Virtual Machine (Java
VM) is highly instrumented using JMX technology. You can easily start a JMX agent to access the built-in
Java VM instrumentation, and thereby monitor and manage the Java VM remotely.


JMX可以使用於JVM。你可以輕易的啓動一個JMX agent 訪問這內置的JVM,因此可以遠程的管理和監控JVM

4 . JMX technology provides a scalable, dynamic management architecture. Every JMX agent service is an
independent module that can be plugged into the management agent, depending on the requirements. This
component-based approach means that JMX solutions can scale from small-footprint devices to large
telecommunications switches and beyond. The JMX specification provides a set of core agent services.
Additional services can be developed and dynamically loaded, unloaded, or updated in the management
infrastructure.


JMX提供一個可升級的,動態管理的構架。每個JMX agent服務都是獨立的模塊,可以根據需求,可插入管理agent中去。這種基於構件的方式意味着JMX解決方案可以在small-footprint 設備和大的 telecommunications之間切換。JMX規範提供一些核心的agent服務,另外的服務可以在管理的底層結構下自行開發,並且能動態加載, 移除和修改。

5.  JMX technology leverages existing standard Java technologies. Whenever needed, the JMX specification
references existing Java specifications, for example, the Java Naming and Directory Interface (JNDI).


JMX技術利用了以前存在的標準Java技術,例如JNDI

6.  Creating JMX applications has been made easier by the creation of a JMX module for the NetBeans IDE 5.0.
 You can obtain the JMX module from the NetBeans Update Center.


使用NetBeans IDE5.0的JMX模塊開發JMX應用已經非常容易了。你可以從NetBeans升級重新獲得這JMX模塊。

7.  JMX technology integrates easily with existing management solutions and emerging technologies. For
example, JMX agents could be managed through an HTML browser. The JMX APIs are open interfaces that any
management system vendor can leverage. JMX solutions can use lookup and discovery services and protocols
such as JiniTM network technology and the Service Location Protocol (SLP).


JMX可以容易的集成已經存在的管理方案和技術。例如:JMX agents可以通過HTML瀏覽器管理,JMX APIs是開放的接口,任何管理系統賣主都可以利用。JMX方案可以使用Jini網絡技術和Service Location Protocol (SLP)來查詢服務。



參考資源:

  官方文檔: http://java.sun.com/javase/6/docs/technotes/guides/jmx/overview/JMXoverviewTOC.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章