spring-framework / org.springframework.jmx.export.assembler / InterfaceBasedMBeanInfoAssembler

InterfaceBasedMBeanInfoAssembler

open class InterfaceBasedMBeanInfoAssembler : AbstractConfigurableMBeanInfoAssembler, BeanClassLoaderAware, InitializingBean

Subclass of AbstractReflectiveMBeanInfoAssembler that allows for the management interface of a bean to be defined using arbitrary interfaces. Any methods or properties that are defined in those interfaces are exposed as MBean operations and attributes.

By default, this class votes on the inclusion of each operation or attribute based on the interfaces implemented by the bean class. However, you can supply an array of interfaces via the managedInterfaces property that will be used instead. If you have multiple beans and you wish each bean to use a different set of interfaces, then you can map bean keys (that is the name used to pass the bean to the MBeanExporter) to a list of interface names using the interfaceMappings property.

If you specify values for both interfaceMappings and managedInterfaces, Spring will attempt to find interfaces in the mappings first. If no interfaces for the bean are found, it will use the interfaces defined by managedInterfaces.

Author
Rob Harrop

Author
Juergen Hoeller

Since
1.2

See Also
#setManagedInterfaces#setInterfaceMappingsMethodNameBasedMBeanInfoAssemblerSimpleReflectiveMBeanInfoAssemblerorg.springframework.jmx.export.MBeanExporter

Constructors

<init>

InterfaceBasedMBeanInfoAssembler()

Subclass of AbstractReflectiveMBeanInfoAssembler that allows for the management interface of a bean to be defined using arbitrary interfaces. Any methods or properties that are defined in those interfaces are exposed as MBean operations and attributes.

By default, this class votes on the inclusion of each operation or attribute based on the interfaces implemented by the bean class. However, you can supply an array of interfaces via the managedInterfaces property that will be used instead. If you have multiple beans and you wish each bean to use a different set of interfaces, then you can map bean keys (that is the name used to pass the bean to the MBeanExporter) to a list of interface names using the interfaceMappings property.

If you specify values for both interfaceMappings and managedInterfaces, Spring will attempt to find interfaces in the mappings first. If no interfaces for the bean are found, it will use the interfaces defined by managedInterfaces.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

setBeanClassLoader

open fun setBeanClassLoader(beanClassLoader: ClassLoader): Unit

setInterfaceMappings

open fun setInterfaceMappings(mappings: Properties): Unit

Set the mappings of bean keys to a comma-separated list of interface names.

The property key should match the bean key and the property value should match the list of interface names. When searching for interfaces for a bean, Spring will check these mappings first.

setManagedInterfaces

open fun setManagedInterfaces(vararg managedInterfaces: Class<*>): Unit

Set the array of interfaces to use for creating the management info. These interfaces will be used for a bean if no entry corresponding to that bean is found in the interfaceMappings property.