JMX, the Java Manager extentin (Java Management extension), is a technique that dynamically alters the value of JavaBean attributes, and can be used in a number of scenarios. For example, using JMX as a switch for online applications, while doing some new and old system modifications
We can use a simple switch bean to switch the old and new business logic on-the-fly to achieve the purpose of real-time rollback.
The basic structure of JMX is as follows:
There are three layers locally, the instrumentatin layer (resource layer), which is used to represent resources, specifically some mbean.
The next layer is the agent layer, which is an mbean container for registering and managing the Mbean, while the agent can use various connector to communicate with the outside world, dynamically set the properties of the Mbean within the container.
The above is the connector layer, implemented a variety of connection protocols, such as HTTP,RMI,SNMP, this layer can also be called the adapter layer.
The remote management layer, known as the Remotes Manager layer, can have multiple representations, such as JMX Manager,web
Browser, and so on. The remote management layer communicates through various protocols and corresponding connectors, pushing the value of the push through the connector to the agent layer, and the agent completes the injection action.
?
From the schema diagram above, we can backward from the schema how to use JMX,
1. Get an Mbean Server
2. Write an Mbean
3. Register the resource Mbean and the connector connector to the Mbean Server.
4. Start Server,manager to access the Mbean through the server.
?
?
"Advanced JEE Technology" JMX