Spring integrates Jmx based on annotations

Spring integrates jmx. I found some before, which are a bit complicated. I will give you an easy-to-understand one. How to 
use Jmx and Java Management Extension

 
spring配置文件添加
<context:mbean-export default-domain="morning" registration="replaceExisting" />

@Component @ManagedResource(objectName = "morning:name=Test", description = "描述") public class TestMBean { private boolean test= true; @ManagedAttribute(description = "Method description" ) public boolean isTest() { return addAdmin; } }

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325135126&siteId=291194637