public class AnnotationMBeanExporter extends MBeanExporter
MBeanExporter
,
activating Java 5 annotation usage for JMX exposure of Spring beans:
ManagedResource
, ManagedAttribute
, ManagedOperation
, etc.
Sets a MetadataNamingStrategy
and a MetadataMBeanInfoAssembler
with an AnnotationJmxAttributeSource
, and activates the
MBeanExporter.AUTODETECT_ALL
mode by default.
Modifier and Type | Field and Description |
---|---|
private AnnotationJmxAttributeSource |
annotationSource |
private MetadataMBeanInfoAssembler |
metadataAssembler |
private MetadataNamingStrategy |
metadataNamingStrategy |
AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE
logger, REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
Constructor and Description |
---|
AnnotationMBeanExporter() |
Modifier and Type | Method and Description |
---|---|
void |
setBeanFactory(BeanFactory beanFactory)
This callback is only required for resolution of bean names in the
"beans" Map and for
autodetection of MBeans (in the latter case, a
ListableBeanFactory is required). |
void |
setDefaultDomain(java.lang.String defaultDomain)
Specify the default domain to be used for generating ObjectNames
when no source-level metadata has been specified.
|
adaptMBeanIfPossible, addExcludedBean, afterPropertiesSet, afterSingletonsInstantiated, createAndConfigureMBean, createModelMBean, destroy, getObjectName, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerBeans, registerManagedResource, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeanClassLoader, setBeans, setEnsureUniqueRuntimeObjectNames, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners, unregisterManagedResource
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationBehavior, setRegistrationBehaviorName, setRegistrationPolicy, setServer, unregisterBeans
private final AnnotationJmxAttributeSource annotationSource
private final MetadataNamingStrategy metadataNamingStrategy
private final MetadataMBeanInfoAssembler metadataAssembler
public void setDefaultDomain(java.lang.String defaultDomain)
The default is to use the domain specified in the bean name (if the bean name follows the JMX ObjectName syntax); else, the package name of the managed bean class.
public void setBeanFactory(BeanFactory beanFactory)
MBeanExporter
"beans"
Map
and for
autodetection of MBeans (in the latter case, a
ListableBeanFactory
is required).setBeanFactory
in interface BeanFactoryAware
setBeanFactory
in class MBeanExporter
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.MBeanExporter.setBeans(java.util.Map<java.lang.String, java.lang.Object>)
,
MBeanExporter.setAutodetect(boolean)