@ManagedResource
public class IntegrationMBeanExporter
extends org.springframework.jmx.export.MBeanExporter
implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.SmartLifecycle
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).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_DOMAIN |
| Constructor and Description |
|---|
IntegrationMBeanExporter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doStart() |
protected void |
doStop() |
int |
getActiveHandlerCount() |
long |
getActiveHandlerCountLong() |
int |
getChannelCount() |
Statistics |
getChannelErrorRate(java.lang.String name) |
MessageChannelMetrics |
getChannelMetrics(java.lang.String name) |
java.lang.String[] |
getChannelNames() |
int |
getChannelReceiveCount(java.lang.String name) |
long |
getChannelReceiveCountLong(java.lang.String name) |
int |
getChannelSendCount(java.lang.String name) |
long |
getChannelSendCountLong(java.lang.String name) |
int |
getChannelSendErrorCount(java.lang.String name) |
long |
getChannelSendErrorCountLong(java.lang.String name) |
Statistics |
getChannelSendRate(java.lang.String name) |
int |
getHandlerCount() |
Statistics |
getHandlerDuration(java.lang.String name) |
MessageHandlerMetrics |
getHandlerMetrics(java.lang.String name) |
java.lang.String[] |
getHandlerNames() |
int |
getPhase() |
int |
getQueuedMessageCount() |
int |
getSourceMessageCount(java.lang.String name) |
long |
getSourceMessageCountLong(java.lang.String name) |
MessageSourceMetrics |
getSourceMetrics(java.lang.String name) |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected void |
orderlyShutdownCapableComponentsAfter() |
protected void |
orderlyShutdownCapableComponentsBefore() |
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName) |
java.lang.Object |
postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName) |
protected void |
registerBeans() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setComponentNamePatterns(java.lang.String[] componentNamePatterns) |
void |
setDefaultDomain(java.lang.String domain)
The JMX domain to use for MBeans registered.
|
void |
setObjectNameStaticProperties(java.util.Map<java.lang.String,java.lang.String> objectNameStaticProperties)
Static properties that will be added to all object names.
|
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
void |
stopActiveChannels() |
void |
stopActiveComponents(boolean force,
long howLong)
Deprecated.
|
void |
stopActiveComponents(long howLong)
Shutdown active components.
|
void |
stopInboundMessageProducers()
Stops all inbound message producers (that are not
OrderlyShutdownCapable)
- may cause interrupts. |
void |
stopMessageSources()
Stops all message sources - may cause interrupts.
|
adaptMBeanIfPossible, addExcludedBean, afterPropertiesSet, afterSingletonsInstantiated, createAndConfigureMBean, createModelMBean, getObjectName, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerManagedResource, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeans, setEnsureUniqueRuntimeObjectNames, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners, unregisterManagedResourcepublic static final java.lang.String DEFAULT_DOMAIN
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwaresetBeanClassLoader in class org.springframework.jmx.export.MBeanExporterpublic void setObjectNameStaticProperties(java.util.Map<java.lang.String,java.lang.String> objectNameStaticProperties)
objectNameStaticProperties - the objectNameStaticProperties to setpublic void setDefaultDomain(java.lang.String domain)
spring.application (which is useful in
SpringSource HQ).domain - the domain name to setpublic void setComponentNamePatterns(java.lang.String[] componentNamePatterns)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwaresetBeanFactory in class org.springframework.jmx.export.MBeanExporterorg.springframework.beans.BeansExceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic java.lang.Object postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic final boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic final int getPhase()
getPhase in interface org.springframework.context.Phasedpublic final boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic final void start()
start in interface org.springframework.context.Lifecyclepublic final void stop()
stop in interface org.springframework.context.Lifecyclepublic final void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecycleprotected void doStop()
protected void doStart()
public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeandestroy in class org.springframework.jmx.export.MBeanExporter@Deprecated
@ManagedOperation
public void stopActiveComponents(boolean force,
long howLong)
stopActiveComponents(long).force - No longer used.howLong - The time to wait in total for all activities to complete
in milliseconds.@ManagedOperation public void stopActiveComponents(long howLong)
howLong - The time to wait in total for all activities to complete
in milliseconds.@ManagedOperation public void stopMessageSources()
@ManagedOperation public void stopInboundMessageProducers()
OrderlyShutdownCapable)
- may cause interrupts.@ManagedOperation public void stopActiveChannels()
protected final void orderlyShutdownCapableComponentsBefore()
protected final void orderlyShutdownCapableComponentsAfter()
@ManagedMetric(metricType=COUNTER,
displayName="MessageChannel Channel Count")
public int getChannelCount()
@ManagedMetric(metricType=COUNTER,
displayName="MessageHandler Handler Count")
public int getHandlerCount()
@ManagedAttribute public java.lang.String[] getHandlerNames()
@ManagedMetric(metricType=GAUGE,
displayName="Active Handler Count")
public int getActiveHandlerCount()
@ManagedMetric(metricType=GAUGE,
displayName="Active Handler Count")
public long getActiveHandlerCountLong()
@ManagedMetric(metricType=GAUGE,
displayName="Queued Message Count")
public int getQueuedMessageCount()
@ManagedAttribute public java.lang.String[] getChannelNames()
public MessageHandlerMetrics getHandlerMetrics(java.lang.String name)
public Statistics getHandlerDuration(java.lang.String name)
public MessageSourceMetrics getSourceMetrics(java.lang.String name)
public int getSourceMessageCount(java.lang.String name)
public long getSourceMessageCountLong(java.lang.String name)
public MessageChannelMetrics getChannelMetrics(java.lang.String name)
public int getChannelSendCount(java.lang.String name)
public long getChannelSendCountLong(java.lang.String name)
public int getChannelSendErrorCount(java.lang.String name)
public long getChannelSendErrorCountLong(java.lang.String name)
public int getChannelReceiveCount(java.lang.String name)
public long getChannelReceiveCountLong(java.lang.String name)
@ManagedOperation public Statistics getChannelSendRate(java.lang.String name)
public Statistics getChannelErrorRate(java.lang.String name)
protected void registerBeans()
registerBeans in class org.springframework.jmx.export.MBeanExporter