@ManagedResource public class IntegrationMBeanExporter extends MBeanExporter implements ApplicationContextAware, DestructionAwareBeanPostProcessor
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 String |
DEFAULT_DOMAIN |
AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE
logger, server
Constructor and Description |
---|
IntegrationMBeanExporter() |
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, unregisterManagedResource
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationPolicy, setServer, unregisterBeans
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
postProcessBeforeInitialization
public static final String DEFAULT_DOMAIN
public void setObjectNameStaticProperties(Map<String,String> objectNameStaticProperties)
objectNameStaticProperties
- the objectNameStaticProperties to setpublic void setDefaultDomain(String domain)
spring.application
(which is useful in
SpringSource HQ).domain
- the domain name to setpublic void setComponentNamePatterns(String[] componentNamePatterns)
componentNamePatterns
- the patterns.public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
setBeanFactory
in class MBeanExporter
public void afterSingletonsInstantiated()
afterSingletonsInstantiated
in interface SmartInitializingSingleton
afterSingletonsInstantiated
in class MBeanExporter
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
postProcessAfterInitialization
in interface BeanPostProcessor
BeansException
public boolean requiresDestruction(Object bean)
requiresDestruction
in interface DestructionAwareBeanPostProcessor
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException
postProcessBeforeDestruction
in interface DestructionAwareBeanPostProcessor
BeansException
@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 Count") public int getChannelCount()
@ManagedMetric(metricType=COUNTER, displayName="MessageHandler Count") public int getHandlerCount()
@ManagedMetric(metricType=COUNTER, displayName="MessageSource Count") public int getSourceCount()
@ManagedAttribute public String[] getHandlerNames()
@Deprecated @ManagedMetric(metricType=GAUGE, displayName="No longer supported") public int getActiveHandlerCount()
@Deprecated @ManagedMetric(metricType=GAUGE, displayName="No longer supported") public long getActiveHandlerCountLong()
@ManagedMetric(metricType=GAUGE, displayName="Queued Message Count") public int getQueuedMessageCount()
@ManagedAttribute public String[] getChannelNames()
@Nullable @Deprecated public AbstractMessageHandler getHandlerMetrics(String name)
@Nullable public IntegrationManagement getHandler(String name)
@ManagedAttribute public String[] getSourceNames()
@Deprecated public IntegrationInboundManagement getSourceMetrics(String name)
@Deprecated public IntegrationManagement getChannelMetrics(String name)
public IntegrationInboundManagement getSource(String name)
public IntegrationManagement getChannel(String name)