com.netflix.config.jmx
Class BaseConfigMBean

java.lang.Object
  extended by com.netflix.config.jmx.BaseConfigMBean
All Implemented Interfaces:
ConfigMBean

public class BaseConfigMBean
extends java.lang.Object
implements ConfigMBean

A basic implementation of a Config MBean that allows for operations on properties contained in the AbstractConfiguration.


Constructor Summary
BaseConfigMBean(org.apache.commons.configuration.AbstractConfiguration config)
           
 
Method Summary
 void addProperty(java.lang.String key, java.lang.String value)
          Calls config.addrProperty().
 void clearProperty(java.lang.String key)
          Calls config.clearProperty().
 java.lang.Object getProperty(java.lang.String key)
          Returns the current value of a property given a key
 java.lang.Object obtainProperties()
          Returns all Properties.
 void updateProperty(java.lang.String key, java.lang.String value)
          Calls config.setProperty().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseConfigMBean

public BaseConfigMBean(org.apache.commons.configuration.AbstractConfiguration config)
Method Detail

obtainProperties

public java.lang.Object obtainProperties()
Description copied from interface: ConfigMBean
Returns all Properties. Yes, this should have ideally returned a Properties, but doing so will make this operation dissapear from the JConsole.

Specified by:
obtainProperties in interface ConfigMBean

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: ConfigMBean
Returns the current value of a property given a key

Specified by:
getProperty in interface ConfigMBean

updateProperty

public void updateProperty(java.lang.String key,
                           java.lang.String value)
Calls config.setProperty(). If the underlying configuration is ConcurrentCompositeConfiguration, it calls ConcurrentCompositeConfiguration.setOverrideProperty(String, Object) instead.

Specified by:
updateProperty in interface ConfigMBean

clearProperty

public void clearProperty(java.lang.String key)
Calls config.clearProperty(). If the underlying configuration is ConcurrentCompositeConfiguration, it calls ConcurrentCompositeConfiguration.clearOverrideProperty(String) instead.

Warning: ConcurrentCompositeConfiguration.clearOverrideProperty(String) does not clear the property with the whole ConcurrentCompositeConfiguration, if any other child configurations in it has the same property.

Specified by:
clearProperty in interface ConfigMBean

addProperty

public void addProperty(java.lang.String key,
                        java.lang.String value)
Calls config.addrProperty(). If the underlying configuration is ConcurrentCompositeConfiguration, it calls ConcurrentCompositeConfiguration.setOverrideProperty(String, Object) instead.

Specified by:
addProperty in interface ConfigMBean