Class IntegrationMBeanExporter
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- BeanPostProcessor,- DestructionAwareBeanPostProcessor,- DisposableBean,- InitializingBean,- SmartInitializingSingleton,- ApplicationContextAware,- MBeanExportOperations
MBean exporter for Spring Integration components in an existing application. Add an instance of this as a bean definition in the same context as the components you need to monitor and all message channels and message handlers will be exposed.
 Channels will report metrics on send and receive (counts, rates, errors) and handlers will report metrics on
 execution duration. Channels will be registered under their name (bean id), if explicit, or the last part of their
 internal name (e.g. "nullChannel") if registered by the framework. A handler that is attached to an endpoint will be
 registered with the endpoint name (bean id) if there is one, otherwise under the name of the input channel. Handler
 object names contain a bean key that reports the source of the name: "endpoint" if the name is the
 endpoint id; "anonymous" if it is the input channel; and "handler" as a fallback, where the object name is just the
 toString() of the handler.
 
 This component is itself an MBean, reporting attributes concerning the names and object names of the channels and
 handlers. It doesn't register itself to avoid conflicts with the standard <context:mbean-export/>
 from Spring (which should therefore be used any time you need to expose those features).
 
- Author:
- Dave Syer, Helena Edelson, Oleg Zhurakousky, Gary Russell, Artem Bilan, Meherzad Lahewala
- 
Field SummaryFieldsFields inherited from class org.springframework.jmx.export.MBeanExporterAUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONEFields inherited from class org.springframework.jmx.support.MBeanRegistrationSupportlogger, server
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidgetChannel(String name) intString[]getHandler(String name) intString[]intintString[]protected final voidprotected final voidpostProcessAfterInitialization(Object bean, String beanName) voidpostProcessBeforeDestruction(Object bean, String beanName) booleanrequiresDestruction(Object bean) voidsetApplicationContext(ApplicationContext applicationContext) voidsetBeanFactory(BeanFactory beanFactory) voidsetComponentNamePatterns(String[] componentNamePatterns) Set the array of simple patterns for component names to register (defaults to '*').voidsetDefaultDomain(String domain) The JMX domain to use for MBeans registered.voidsetObjectNameStaticProperties(Map<String, String> objectNameStaticProperties) Static properties that will be added to all object names.voidvoidstopActiveComponents(long howLong) Shutdown active components.voidStops all inbound message producers (that are notOrderlyShutdownCapable) - may cause interrupts.voidStops all message sources - may cause interrupts.Methods inherited from class org.springframework.jmx.export.MBeanExporteradaptMBeanIfPossible, addExcludedBean, 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, unregisterManagedResourceMethods inherited from class org.springframework.jmx.support.MBeanRegistrationSupportdoRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationPolicy, setServer, unregisterBeansMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.config.BeanPostProcessorpostProcessBeforeInitialization
- 
Field Details- 
DEFAULT_DOMAIN- See Also:
 
 
- 
- 
Constructor Details- 
IntegrationMBeanExporterpublic IntegrationMBeanExporter()
 
- 
- 
Method Details- 
setObjectNameStaticProperties
- 
setDefaultDomainThe JMX domain to use for MBeans registered. Defaults tospring.application(which is useful in SpringSource HQ).- Parameters:
- domain- the domain name to set
 
- 
setComponentNamePatternsSet the array of simple patterns for component names to register (defaults to '*'). The pattern is applied to all components before they are registered, looking for a match on the 'name' property of the ObjectName. A MessageChannel and a MessageHandler (for instance) can share a name because they have a different type, so in that case they would either both be included or both excluded. Since version 4.2, a leading '!' negates the pattern match ('!foo*' means don't export components where the name matches the pattern 'foo*'). For components with names that match multiple patterns, the first pattern wins.- Parameters:
- componentNamePatterns- the patterns.
 
- 
setApplicationContext- Specified by:
- setApplicationContextin interface- ApplicationContextAware
- Throws:
- BeansException
 
- 
setBeanFactory- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Overrides:
- setBeanFactoryin class- MBeanExporter
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
- Overrides:
- afterPropertiesSetin class- MBeanExporter
 
- 
afterSingletonsInstantiatedpublic void afterSingletonsInstantiated()- Specified by:
- afterSingletonsInstantiatedin interface- SmartInitializingSingleton
- Overrides:
- afterSingletonsInstantiatedin class- MBeanExporter
 
- 
postProcessAfterInitialization- Specified by:
- postProcessAfterInitializationin interface- BeanPostProcessor
- Throws:
- BeansException
 
- 
requiresDestruction- Specified by:
- requiresDestructionin interface- DestructionAwareBeanPostProcessor
 
- 
postProcessBeforeDestruction- Specified by:
- postProcessBeforeDestructionin interface- DestructionAwareBeanPostProcessor
- Throws:
- BeansException
 
- 
stopActiveComponentsShutdown active components.- Parameters:
- howLong- The time to wait in total for all activities to complete in milliseconds.
 
- 
stopMessageSourcesStops all message sources - may cause interrupts.
- 
stopInboundMessageProducersStops all inbound message producers (that are notOrderlyShutdownCapable) - may cause interrupts.
- 
stopActiveChannels
- 
orderlyShutdownCapableComponentsBeforeprotected final void orderlyShutdownCapableComponentsBefore()
- 
orderlyShutdownCapableComponentsAfterprotected final void orderlyShutdownCapableComponentsAfter()
- 
getChannelCount
- 
getHandlerCount
- 
getSourceCount
- 
getHandlerNames
- 
getQueuedMessageCount@ManagedMetric(metricType=GAUGE, displayName="Queued Message Count") public int getQueuedMessageCount()
- 
getChannelNames
- 
getHandler
- 
getSourceNames
- 
getSource
- 
getChannel
 
-