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 Summary
FieldsFields inherited from class org.springframework.jmx.export.MBeanExporter
AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONEFields inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
logger, server -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoid@Nullable IntegrationManagementgetChannel(String name) intString[]@Nullable IntegrationManagementgetHandler(String name) intString[]int@Nullable IntegrationInboundManagementintString[]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.MBeanExporter
adaptMBeanIfPossible, 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.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationPolicy, setServer, unregisterBeansMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessBeforeInitialization
-
Field Details
-
DEFAULT_DOMAIN
- See Also:
-
-
Constructor Details
-
IntegrationMBeanExporter
public IntegrationMBeanExporter()
-
-
Method Details
-
setObjectNameStaticProperties
-
setDefaultDomain
The JMX domain to use for MBeans registered. Defaults tospring.application(which is useful in SpringSource HQ).- Parameters:
domain- the domain name to set
-
setComponentNamePatterns
Set 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 interfaceApplicationContextAware- Throws:
BeansException
-
setBeanFactory
- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- Overrides:
setBeanFactoryin classMBeanExporter
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classMBeanExporter
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceSmartInitializingSingleton- Overrides:
afterSingletonsInstantiatedin classMBeanExporter
-
postProcessAfterInitialization
- Specified by:
postProcessAfterInitializationin interfaceBeanPostProcessor- Throws:
BeansException
-
requiresDestruction
- Specified by:
requiresDestructionin interfaceDestructionAwareBeanPostProcessor
-
postProcessBeforeDestruction
- Specified by:
postProcessBeforeDestructionin interfaceDestructionAwareBeanPostProcessor- Throws:
BeansException
-
stopActiveComponents
Shutdown active components.- Parameters:
howLong- The time to wait in total for all activities to complete in milliseconds.
-
stopMessageSources
Stops all message sources - may cause interrupts. -
stopInboundMessageProducers
Stops all inbound message producers (that are notOrderlyShutdownCapable) - may cause interrupts. -
stopActiveChannels
-
orderlyShutdownCapableComponentsBefore
protected final void orderlyShutdownCapableComponentsBefore() -
orderlyShutdownCapableComponentsAfter
protected final void orderlyShutdownCapableComponentsAfter() -
getChannelCount
-
getHandlerCount
-
getSourceCount
-
getHandlerNames
-
getQueuedMessageCount
@ManagedMetric(metricType=GAUGE, displayName="Queued Message Count") public int getQueuedMessageCount() -
getChannelNames
-
getHandler
-
getSourceNames
-
getSource
-
getChannel
-