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_NONEFields inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
logger, serverFields inherited from interface com.atlassian.confluence.jmx.MBeanExporterWithUnregister
PROPERTY_NAME_JMX_DISABLED -
Constructor Summary
ConstructorsConstructorDescriptionMBeanExporterWithUnregisterImpl(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.tenancy.api.TenantAccessor tenantAccessor) Deprecated, for removal: This API element is subject to removal in a future version.since 9.4 -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()booleanDetermines whether or not the export is enabled.booleanisRegistered(ObjectName name) Determines whether the object has been registered.voidregisterManagedResource(Object o, ObjectName objectName) voidsafeRegisterManagedResource(Object value, ObjectName name) Registers the MBean with a given name.voidsetLazyBeans(Map<String, Supplier<Object>> lazyBeans) voidunregisterBean(ObjectName name) Deprecated.since 5.10.voidunregisterManagedResource(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, setNotificationListenersMethods inherited from class org.springframework.jmx.support.MBeanRegistrationSupport
doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, setRegistrationPolicy, setServer, unregisterBeansMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.jmx.export.MBeanExportOperations
registerManagedResource
-
Constructor Details
-
MBeanExporterWithUnregisterImpl
@Deprecated(since="9.4", forRemoval=true) public MBeanExporterWithUnregisterImpl(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.tenancy.api.TenantAccessor tenantAccessor) Deprecated, for removal: This API element is subject to removal in a future version.since 9.4
-
-
Method Details
-
setLazyBeans
-
isEnabled
public boolean isEnabled()Description copied from interface:MBeanExporterWithUnregisterDetermines 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:
isEnabledin interfaceMBeanExporterWithUnregister- Returns:
- true if enabled
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.jmx.export.MBeanExporter
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Overrides:
destroyin classorg.springframework.jmx.export.MBeanExporter
-
unregisterManagedResource
- Specified by:
unregisterManagedResourcein interfaceorg.springframework.jmx.export.MBeanExportOperations- Overrides:
unregisterManagedResourcein classorg.springframework.jmx.export.MBeanExporter
-
unregisterBean
Deprecated.since 5.10. UseunregisterManagedResource(javax.management.ObjectName)instead.Description copied from interface:MBeanExporterWithUnregisterUnregistered the MBean with the given name. This means that it will no longer be managed by the JMX agent.- Specified by:
unregisterBeanin interfaceMBeanExporterWithUnregister- Parameters:
name- of the resource to be unregistered.
-
isRegistered
Description copied from interface:MBeanExporterWithUnregisterDetermines whether the object has been registered.- Specified by:
isRegisteredin interfaceMBeanExporterWithUnregister- Returns:
- true if registered
-
safeRegisterManagedResource
Description copied from interface:MBeanExporterWithUnregisterRegisters 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:
safeRegisterManagedResourcein interfaceMBeanExporterWithUnregister- Parameters:
value- - MBean objectname- of the resource
-
registerManagedResource
public void registerManagedResource(Object o, ObjectName objectName) throws org.springframework.jmx.export.MBeanExportException - Specified by:
registerManagedResourcein interfaceorg.springframework.jmx.export.MBeanExportOperations- Overrides:
registerManagedResourcein classorg.springframework.jmx.export.MBeanExporter- Throws:
org.springframework.jmx.export.MBeanExportException
-