Class EndpointMBeanExporter
- java.lang.Object
- org.springframework.jmx.support.MBeanRegistrationSupport
- org.springframework.jmx.export.MBeanExporter
- org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.beans.factory.SmartInitializingSingleton
,org.springframework.context.ApplicationContextAware
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,org.springframework.jmx.export.MBeanExportOperations
public class EndpointMBeanExporter extends org.springframework.jmx.export.MBeanExporter implements org.springframework.context.SmartLifecycle, org.springframework.context.ApplicationContextAware
SmartLifecycle
bean that registers all knownEndpoint
s with anMBeanServer
using theMBeanExporter
located from the application context.
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DOMAIN
The default JMX domain.
Constructor Summary
Constructors Constructor Description EndpointMBeanExporter()
Create a newEndpointMBeanExporter
instance.EndpointMBeanExporter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Create a newEndpointMBeanExporter
instance.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected JmxEndpoint
adaptEndpoint(String beanName, Endpoint<?> endpoint)
Adapt the givenEndpoint
to aJmxEndpoint
.protected void
doStart()
protected EndpointMBean
getEndpointMBean(String beanName, Endpoint<?> endpoint)
Deprecated.as of 1.5 in favor ofadaptEndpoint(String, Endpoint)
protected ObjectName
getObjectName(Object bean, String beanKey)
int
getPhase()
boolean
isAutoStartup()
boolean
isRunning()
protected void
locateAndRegisterEndpoints()
protected void
registerEndpoint(String beanName, Endpoint<?> endpoint)
Deprecated.as of 1.5 in favor of directJmxEndpoint
registration oradaptEndpoint(String, Endpoint)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
setDomain(String domain)
void
setEnsureUniqueRuntimeObjectNames(boolean ensureUniqueRuntimeObjectNames)
void
setObjectNameStaticProperties(Properties objectNameStaticProperties)
void
start()
void
stop()
void
stop(Runnable callback)
Methods inherited from class org.springframework.jmx.export.MBeanExporter
adaptMBeanIfPossible, addExcludedBean, afterPropertiesSet, afterSingletonsInstantiated, createAndConfigureMBean, createModelMBean, destroy, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerBeans, registerManagedResource, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeanClassLoader, setBeans, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners, unregisterManagedResource
Field Detail
DEFAULT_DOMAIN
public static final String DEFAULT_DOMAIN
The default JMX domain.- See Also:
- Constant Field Values
Constructor Detail
EndpointMBeanExporter
public EndpointMBeanExporter()
Create a newEndpointMBeanExporter
instance.
EndpointMBeanExporter
public EndpointMBeanExporter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Create a newEndpointMBeanExporter
instance.- Parameters:
objectMapper
- the object mapper
Method Detail
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Overrides:
setBeanFactory
in classorg.springframework.jmx.export.MBeanExporter
setEnsureUniqueRuntimeObjectNames
public void setEnsureUniqueRuntimeObjectNames(boolean ensureUniqueRuntimeObjectNames)
- Overrides:
setEnsureUniqueRuntimeObjectNames
in classorg.springframework.jmx.export.MBeanExporter
setObjectNameStaticProperties
public void setObjectNameStaticProperties(Properties objectNameStaticProperties)
doStart
protected void doStart()
locateAndRegisterEndpoints
protected void locateAndRegisterEndpoints()
registerEndpoint
@Deprecated protected void registerEndpoint(String beanName, Endpoint<?> endpoint)
Deprecated.as of 1.5 in favor of directJmxEndpoint
registration oradaptEndpoint(String, Endpoint)
Register a regularEndpoint
with theMBeanServer
.- Parameters:
beanName
- the bean nameendpoint
- the endpoint to register
adaptEndpoint
protected JmxEndpoint adaptEndpoint(String beanName, Endpoint<?> endpoint)
Adapt the givenEndpoint
to aJmxEndpoint
.- Parameters:
beanName
- the bean nameendpoint
- the endpoint to adapt- Returns:
- an adapted endpoint
getEndpointMBean
@Deprecated protected EndpointMBean getEndpointMBean(String beanName, Endpoint<?> endpoint)
Deprecated.as of 1.5 in favor ofadaptEndpoint(String, Endpoint)
Get aEndpointMBean
for the specifiedEndpoint
.- Parameters:
beanName
- the bean nameendpoint
- the endpoint- Returns:
- an
EndpointMBean
getObjectName
protected ObjectName getObjectName(Object bean, String beanKey) throws MalformedObjectNameException
- Overrides:
getObjectName
in classorg.springframework.jmx.export.MBeanExporter
- Throws:
MalformedObjectNameException
getPhase
public final int getPhase()
- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
isAutoStartup
public final boolean isAutoStartup()
- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
isRunning
public final boolean isRunning()
- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
start
public final void start()
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
stop
public final void stop()
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle