0

I have a spring project where I have my custom mbeans(defined by user) and mbeans provided by jars. If I don't have to expose few operations of custom mbeans, I can put the mathod name values in assembler under properties : ignoredMethods. My question is : If i don't have to expose the method of a third party jar mbean which is already exposed, what should I do?

sapa
  • 23
  • 3

1 Answers1

0

If the third party jars are themselves registering the MBeans with the MBeanServer internally, you have no control. If you are using Spring to expose the MBeans, then you can control what's exposed.

EDIT:

If you are using <context:mbean-export/>, it creates an AnnotationMBeanExporter which will auto-detect classes matching the MBean naming rules by default.

You can turn it off by declaring the exporter as a <bean/> instead and setting its autoDectedMode to 0, or autoDetectModeName to AUTODETECT_NONE.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • In third party jar, I didn't find any context.xml(after de-compiling). Is it possible if Interface name ends with "ClassNameMBean" and implementation class name is "ClassName" then mbean server will automatically register that class as mbean in the jar? – sapa Jun 26 '14 at 17:19
  • It won't register MBeans that are not in the application context. However, the third party jar might be registering the MBeans itself (using java code). Of course, if you define a `` for a third party class that follows the MBean naming convention then, yes, it will be registered, but I edited my answer to show how to disable that. – Gary Russell Jun 26 '14 at 17:39