Package com.atlassian.confluence.jmx
Class MBeanExporterWithUnregisterImpl
java.lang.Object
org.springframework.jmx.support.MBeanRegistrationSupport
org.springframework.jmx.export.MBeanExporter
com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl
- All Implemented Interfaces:
MBeanExporterWithUnregister
,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.jmx.export.MBeanExportOperations
public class MBeanExporterWithUnregisterImpl
extends org.springframework.jmx.export.MBeanExporter
implements MBeanExporterWithUnregister
Extends Spring's MBeanExporter to provide server state checks around any JMX registration changes.
-
Field Summary
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
logger, server
Fields inherited from interface com.atlassian.confluence.jmx.MBeanExporterWithUnregister
PROPERTY_NAME_JMX_DISABLED
-
Constructor Summary
ConstructorDescriptionMBeanExporterWithUnregisterImpl
(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.tenancy.api.TenantAccessor tenantAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
boolean
Determines whether or not the export is enabled.boolean
isRegistered
(ObjectName name) Determines whether the object has been registered.void
registerManagedResource
(Object o, ObjectName objectName) void
safeRegisterManagedResource
(Object value, ObjectName name) Registers the MBean with a given name.void
setLazyBeans
(Map<String, Supplier<Object>> lazyBeans) void
unregisterBean
(ObjectName name) Deprecated.since 5.10.void
unregisterManagedResource
(ObjectName objectName) Methods inherited from class org.springframework.jmx.export.MBeanExporter
adaptMBeanIfPossible, addExcludedBean, afterSingletonsInstantiated, createAndConfigureMBean, createModelMBean, getObjectName, isBeanDefinitionLazyInit, isMBean, onRegister, onUnregister, registerBeanNameOrInstance, registerBeans, registerManagedResource, setAllowEagerInit, setAssembler, setAutodetect, setAutodetectMode, setAutodetectModeName, setBeanClassLoader, setBeanFactory, setBeans, setEnsureUniqueRuntimeObjectNames, setExcludedBeans, setExposeManagedResourceClassLoader, setListeners, setNamingStrategy, setNotificationListenerMappings, setNotificationListeners
Methods inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationPolicy, setServer, unregisterBeans
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jmx.export.MBeanExportOperations
registerManagedResource
-
Constructor Details
-
MBeanExporterWithUnregisterImpl
public MBeanExporterWithUnregisterImpl(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.tenancy.api.TenantAccessor tenantAccessor)
-
-
Method Details
-
setLazyBeans
-
isEnabled
public boolean isEnabled()Description copied from interface:MBeanExporterWithUnregister
Determines whether or not the export is enabled. If not enabled, the Exporter will not be able to register or unregister any MBeans. If the system property "confluence.jmx.disabled" is set to true, this method will always return false.- Specified by:
isEnabled
in interfaceMBeanExporterWithUnregister
- Returns:
- true if enabled
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.jmx.export.MBeanExporter
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Overrides:
destroy
in classorg.springframework.jmx.export.MBeanExporter
-
unregisterManagedResource
- Specified by:
unregisterManagedResource
in interfaceorg.springframework.jmx.export.MBeanExportOperations
- Overrides:
unregisterManagedResource
in classorg.springframework.jmx.export.MBeanExporter
-
unregisterBean
Deprecated.since 5.10. UseunregisterManagedResource(javax.management.ObjectName)
instead.Description copied from interface:MBeanExporterWithUnregister
Unregistered the MBean with the given name. This means that it will no longer be managed by the JMX agent.- Specified by:
unregisterBean
in interfaceMBeanExporterWithUnregister
- Parameters:
name
- of the resource to be unregistered.
-
isRegistered
Description copied from interface:MBeanExporterWithUnregister
Determines whether the object has been registered.- Specified by:
isRegistered
in interfaceMBeanExporterWithUnregister
- Returns:
- true if registered
-
safeRegisterManagedResource
Description copied from interface:MBeanExporterWithUnregister
Registers the MBean with a given name. If a duplicate MBean is found the object will be overwritten and any other errors logged and swallowed.- Specified by:
safeRegisterManagedResource
in interfaceMBeanExporterWithUnregister
- Parameters:
value
- - MBean objectname
- of the resource
-
registerManagedResource
public void registerManagedResource(Object o, ObjectName objectName) throws org.springframework.jmx.export.MBeanExportException - Specified by:
registerManagedResource
in interfaceorg.springframework.jmx.export.MBeanExportOperations
- Overrides:
registerManagedResource
in classorg.springframework.jmx.export.MBeanExporter
- Throws:
org.springframework.jmx.export.MBeanExportException
-