简体   繁体   中英

Spring JMX - registering classes in a package as MBeans

I'm setting up JMX support in my application using Spring JMX. It seems relatively easy to do, but I'm wondering about one thing regarding MBean registration. I know that there are (at least two) different ways to register classes as MBeans, but in order to do so, you need to either specify the beans to be registered as MBeans in an XML configuration or you need to annotate the classes with @ManagedResource. I'm wondering if there is a way to specify a package and have Spring automatically register all classes in that package as MBeans.

Thank you for your answers.

No. I have worked with Spring JMX quite a bit and there is nothing like that. The two ways you mentioned (and also through Java configuration) are the only ways to register MBeans within Spring.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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