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

    Constructors
    Constructor
    Description
    MBeanExporterWithUnregisterImpl(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.tenancy.api.TenantAccessor tenantAccessor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    boolean
    Determines whether or not the export is enabled.
    boolean
    Determines whether the object has been registered.
    void
     
    void
    Registers the MBean with a given name.
    void
     
    void
    Deprecated.
    since 5.10.
    void
     

    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

      public void setLazyBeans(Map<String,Supplier<Object>> lazyBeans)
    • 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 interface MBeanExporterWithUnregister
      Returns:
      true if enabled
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.jmx.export.MBeanExporter
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Overrides:
      destroy in class org.springframework.jmx.export.MBeanExporter
    • unregisterManagedResource

      public void unregisterManagedResource(ObjectName objectName)
      Specified by:
      unregisterManagedResource in interface org.springframework.jmx.export.MBeanExportOperations
      Overrides:
      unregisterManagedResource in class org.springframework.jmx.export.MBeanExporter
    • unregisterBean

      @Deprecated public void unregisterBean(ObjectName name)
      Deprecated.
      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 interface MBeanExporterWithUnregister
      Parameters:
      name - of the resource to be unregistered.
    • isRegistered

      public boolean isRegistered(ObjectName name)
      Description copied from interface: MBeanExporterWithUnregister
      Determines whether the object has been registered.
      Specified by:
      isRegistered in interface MBeanExporterWithUnregister
      Returns:
      true if registered
    • safeRegisterManagedResource

      public void safeRegisterManagedResource(Object value, ObjectName name)
      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 interface MBeanExporterWithUnregister
      Parameters:
      value - - MBean object
      name - of the resource
    • registerManagedResource

      public void registerManagedResource(Object o, ObjectName objectName) throws org.springframework.jmx.export.MBeanExportException
      Specified by:
      registerManagedResource in interface org.springframework.jmx.export.MBeanExportOperations
      Overrides:
      registerManagedResource in class org.springframework.jmx.export.MBeanExporter
      Throws:
      org.springframework.jmx.export.MBeanExportException