Class IntegrationMBeanExporter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.config.BeanPostProcessor,org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.ApplicationContextAware,org.springframework.jmx.export.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).
-
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 TypeMethodDescriptionvoidorg.springframework.integration.support.management.IntegrationManagementgetChannel(String name) intString[]org.springframework.integration.support.management.IntegrationManagementgetHandler(String name) intString[]intorg.springframework.integration.support.management.IntegrationInboundManagementintString[]protected final voidprotected final voidpostProcessAfterInitialization(Object bean, String beanName) voidpostProcessBeforeDestruction(Object bean, String beanName) booleanrequiresDestruction(Object bean) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetBeanFactory(org.springframework.beans.factory.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, afterPropertiesSet, 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
Static properties that will be added to all object names.- Parameters:
objectNameStaticProperties- the objectNameStaticProperties to set
-
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
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Overrides:
setBeanFactoryin classorg.springframework.jmx.export.MBeanExporter
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton- Overrides:
afterSingletonsInstantiatedin classorg.springframework.jmx.export.MBeanExporter
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessAfterInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
requiresDestruction
- Specified by:
requiresDestructionin interfaceorg.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
-
postProcessBeforeDestruction
public void postProcessBeforeDestruction(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessBeforeDestructionin interfaceorg.springframework.beans.factory.config.DestructionAwareBeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
stopActiveComponents
@ManagedOperation public void stopActiveComponents(long howLong) Shutdown active components.- Parameters:
howLong- The time to wait in total for all activities to complete in milliseconds.
-
stopMessageSources
@ManagedOperation public void stopMessageSources()Stops all message sources - may cause interrupts. -
stopInboundMessageProducers
@ManagedOperation public void stopInboundMessageProducers()Stops all inbound message producers (that are notOrderlyShutdownCapable) - may cause interrupts. -
stopActiveChannels
@ManagedOperation public void stopActiveChannels() -
orderlyShutdownCapableComponentsBefore
protected final void orderlyShutdownCapableComponentsBefore() -
orderlyShutdownCapableComponentsAfter
protected final void orderlyShutdownCapableComponentsAfter() -
getChannelCount
@ManagedMetric(metricType=COUNTER, displayName="MessageChannel Count") public int getChannelCount() -
getHandlerCount
@ManagedMetric(metricType=COUNTER, displayName="MessageHandler Count") public int getHandlerCount() -
getSourceCount
@ManagedMetric(metricType=COUNTER, displayName="MessageSource Count") public int getSourceCount() -
getHandlerNames
-
getQueuedMessageCount
@ManagedMetric(metricType=GAUGE, displayName="Queued Message Count") public int getQueuedMessageCount() -
getChannelNames
-
getHandler
@Nullable public org.springframework.integration.support.management.IntegrationManagement getHandler(String name) -
getSourceNames
-
getSource
public org.springframework.integration.support.management.IntegrationInboundManagement getSource(String name) -
getChannel
public org.springframework.integration.support.management.IntegrationManagement getChannel(String name)
-