Spring Integration

org.springframework.integration.monitor
Class IntegrationMBeanExporter

java.lang.Object
  extended by org.springframework.jmx.support.MBeanRegistrationSupport
      extended by org.springframework.jmx.export.MBeanExporter
          extended by org.springframework.integration.monitor.IntegrationMBeanExporter
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, DisposableBean, InitializingBean, Lifecycle, Phased, SmartLifecycle, ObjectNameLocator, MBeanExportOperations

@ManagedResource
public class IntegrationMBeanExporter
extends MBeanExporter
implements BeanPostProcessor, BeanFactoryAware, BeanClassLoaderAware, SmartLifecycle, ObjectNameLocator

MBean exporter for Spring Integration components in an existing application.

Author:
Dave Syer, Helena Edelson

Field Summary
static String DEFAULT_DOMAIN
           
 
Fields inherited from class org.springframework.jmx.export.MBeanExporter
AUTODETECT_ALL, AUTODETECT_ASSEMBLER, AUTODETECT_MBEAN, AUTODETECT_NONE
 
Fields inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
registeredBeans, REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
 
Constructor Summary
IntegrationMBeanExporter()
           
 
Method Summary
 void destroy()
           
protected  void doStart()
           
protected  void doStop()
           
 double getChannelCount()
           
 double getChannelErrorRate(String name)
           
 double getChannelMeanSendDuration(String name)
           
 Collection<String> getChannelNames()
           
 long getChannelReceiveCount(String name)
           
 long getChannelSendCount(String name)
           
 long getChannelSendErrorCount(String name)
           
 double getChannelSendRate(String name)
           
 double getHandlerCount()
           
 double getHandlerMeanDuration(String name)
           
 Collection<String> getHandlerNames()
           
 String getObjectName(String beanName)
           
 Map<String,String> getObjectNames()
           
 int getPhase()
           
 boolean isAutoStartup()
           
 boolean isRunning()
           
 Object postProcessAfterInitialization(Object bean, String beanName)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
protected  void registerBeans()
           
 void setBeanClassLoader(ClassLoader classLoader)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 void setDomain(String domain)
          The JMX domain to use for MBeans registered.
 void setObjectNameStaticProperties(Map<String,String> objectNameStaticProperties)
          Static properties that will be added to all object names.
 void start()
           
 void stop()
           
 void stop(Runnable callback)
           
 
Methods inherited from class org.springframework.jmx.export.MBeanExporter
adaptMBeanIfPossible, afterPropertiesSet, createAndConfigureMBean, createModelMBean, getObjectName, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerManagedResource, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeans, setEnsureUniqueRuntimeObjectNames, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners, unregisterManagedResource
 
Methods inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationBehavior, setRegistrationBehaviorName, setServer, unregisterBeans
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DOMAIN

public static final String DEFAULT_DOMAIN
See Also:
Constant Field Values
Constructor Detail

IntegrationMBeanExporter

public IntegrationMBeanExporter()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware
Overrides:
setBeanClassLoader in class MBeanExporter

setObjectNameStaticProperties

public void setObjectNameStaticProperties(Map<String,String> objectNameStaticProperties)
Static properties that will be added to all object names.

Parameters:
objectNameStaticProperties - the objectNameStaticProperties to set

setDomain

public void setDomain(String domain)
The JMX domain to use for MBeans registered. Defaults to spring.application (which is useful in SpringSource HQ).

Parameters:
domain - the domain name to set

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Specified by:
setBeanFactory in interface BeanFactoryAware
Overrides:
setBeanFactory in class MBeanExporter
Throws:
BeansException

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Throws:
BeansException

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Throws:
BeansException

registerBeans

protected void registerBeans()
Overrides:
registerBeans in class MBeanExporter

isAutoStartup

public final boolean isAutoStartup()
Specified by:
isAutoStartup in interface SmartLifecycle

getPhase

public final int getPhase()
Specified by:
getPhase in interface Phased

isRunning

public final boolean isRunning()
Specified by:
isRunning in interface Lifecycle

start

public final void start()
Specified by:
start in interface Lifecycle

stop

public final void stop()
Specified by:
stop in interface Lifecycle

stop

public final void stop(Runnable callback)
Specified by:
stop in interface SmartLifecycle

doStop

protected void doStop()

doStart

protected void doStart()

destroy

public void destroy()
Specified by:
destroy in interface DisposableBean
Overrides:
destroy in class MBeanExporter

getChannelCount

@ManagedMetric(metricType=COUNTER,
               displayName="MessageChannel Channel Count")
public double getChannelCount()

getHandlerCount

@ManagedMetric(metricType=COUNTER,
               displayName="MessageHandler Handler Count")
public double getHandlerCount()

getHandlerNames

@ManagedAttribute
public Collection<String> getHandlerNames()

getChannelNames

@ManagedAttribute
public Collection<String> getChannelNames()

getObjectName

@ManagedOperation(description="Get the JMX object name (as a String) for the specified Spring bean name")
public String getObjectName(String beanName)
Specified by:
getObjectName in interface ObjectNameLocator

getObjectNames

@ManagedAttribute(description="Get a map from Spring bean names to JMX object names registered by this exporter")
public Map<String,String> getObjectNames()
Specified by:
getObjectNames in interface ObjectNameLocator

getHandlerMeanDuration

public double getHandlerMeanDuration(String name)

getChannelSendCount

public long getChannelSendCount(String name)

getChannelSendErrorCount

public long getChannelSendErrorCount(String name)

getChannelReceiveCount

public long getChannelReceiveCount(String name)

getChannelSendRate

public double getChannelSendRate(String name)

getChannelErrorRate

public double getChannelErrorRate(String name)

getChannelMeanSendDuration

public double getChannelMeanSendDuration(String name)

Spring Integration

Copyright © 2010. All Rights Reserved.