com.atlassian.confluence.jmx
Class MBeanExporterWithUnregisterImpl

java.lang.Object
  extended by org.springframework.jmx.support.MBeanRegistrationSupport
      extended by org.springframework.jmx.export.MBeanExporter
          extended by com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl
All Implemented Interfaces:
MBeanExporterWithUnregister, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.MBeanExportOperations

public class MBeanExporterWithUnregisterImpl
extends org.springframework.jmx.export.MBeanExporter
implements MBeanExporterWithUnregister

Extends Spring's MBeanExporter to provide an unregister operation (which for some reason they don't have).


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, registeredBeans, REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING, server
 
Fields inherited from interface com.atlassian.confluence.jmx.MBeanExporterWithUnregister
PROPERTY_NAME_JMX_DISABLED
 
Constructor Summary
MBeanExporterWithUnregisterImpl(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.tenancy.api.TenantAccessor tenantAccessor)
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 boolean isEnabled()
          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 unregisterBean(ObjectName name)
          Unregistered the MBean with the given name.
 
Methods inherited from class org.springframework.jmx.export.MBeanExporter
adaptMBeanIfPossible, 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, setRegistrationBehavior, setRegistrationBehaviorName, 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 Detail

MBeanExporterWithUnregisterImpl

public MBeanExporterWithUnregisterImpl(com.atlassian.event.api.EventPublisher eventPublisher,
                                       com.atlassian.tenancy.api.TenantAccessor tenantAccessor)
Method Detail

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

unregisterBean

public void unregisterBean(ObjectName name)
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


Copyright © 2003–2015 Atlassian. All rights reserved.