|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.config.ConfigurationWithPollingSource
public class ConfigurationWithPollingSource
This class delegates property read/write to an another configuration but is also attached with a dynamic configuration source and polling scheduler so that its properties can be changed dynamically at runtime. In other words, if the same property is defined in both the original configuration and the dynamic configuration source, the value in the original configuration will be overridden.
This class can be served as a decorator to an existing configuration to make the property values dynamic.
Constructor Summary | |
---|---|
ConfigurationWithPollingSource(org.apache.commons.configuration.Configuration config,
PolledConfigurationSource source,
AbstractPollingScheduler scheduler)
Create an instance and start polling the configuration source |
Method Summary | |
---|---|
void |
addProperty(java.lang.String key,
java.lang.Object value)
Delegates to the underlying configuration. |
void |
clear()
Delegates to the underlying configuration. |
void |
clearProperty(java.lang.String key)
Delegates to the underlying configuration. |
boolean |
containsKey(java.lang.String arg0)
Delegates to the underlying configuration. |
java.math.BigDecimal |
getBigDecimal(java.lang.String key)
Delegates to the underlying configuration. |
java.math.BigDecimal |
getBigDecimal(java.lang.String key,
java.math.BigDecimal defaultValue)
Delegates to the underlying configuration. |
java.math.BigInteger |
getBigInteger(java.lang.String key)
Delegates to the underlying configuration. |
java.math.BigInteger |
getBigInteger(java.lang.String key,
java.math.BigInteger defaultValue)
Delegates to the underlying configuration. |
boolean |
getBoolean(java.lang.String key)
Delegates to the underlying configuration. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Delegates to the underlying configuration. |
java.lang.Boolean |
getBoolean(java.lang.String key,
java.lang.Boolean defaultValue)
Delegates to the underlying configuration. |
byte |
getByte(java.lang.String key)
Delegates to the underlying configuration. |
byte |
getByte(java.lang.String key,
byte defaultValue)
Delegates to the underlying configuration. |
java.lang.Byte |
getByte(java.lang.String key,
java.lang.Byte defaultValue)
Delegates to the underlying configuration. |
org.apache.commons.configuration.Configuration |
getConfiguration()
|
double |
getDouble(java.lang.String key)
Delegates to the underlying configuration. |
double |
getDouble(java.lang.String key,
double defaultValue)
Delegates to the underlying configuration. |
java.lang.Double |
getDouble(java.lang.String key,
java.lang.Double defaultValue)
Delegates to the underlying configuration. |
float |
getFloat(java.lang.String key)
Delegates to the underlying configuration. |
float |
getFloat(java.lang.String key,
float defaultValue)
Delegates to the underlying configuration. |
java.lang.Float |
getFloat(java.lang.String key,
java.lang.Float defaultValue)
Delegates to the underlying configuration. |
int |
getInt(java.lang.String key)
Delegates to the underlying configuration. |
int |
getInt(java.lang.String key,
int defaultValue)
Delegates to the underlying configuration. |
java.lang.Integer |
getInteger(java.lang.String key,
java.lang.Integer defaultValue)
Delegates to the underlying configuration. |
java.util.Iterator |
getKeys()
Delegates to the underlying configuration. |
java.util.Iterator |
getKeys(java.lang.String prefix)
Delegates to the underlying configuration. |
java.util.List |
getList(java.lang.String key)
Delegates to the underlying configuration. |
java.util.List |
getList(java.lang.String key,
java.util.List defaultValue)
Delegates to the underlying configuration. |
long |
getLong(java.lang.String key)
Delegates to the underlying configuration. |
long |
getLong(java.lang.String key,
long defaultValue)
Delegates to the underlying configuration. |
java.lang.Long |
getLong(java.lang.String key,
java.lang.Long defaultValue)
Delegates to the underlying configuration. |
java.util.Properties |
getProperties(java.lang.String key)
Delegates to the underlying configuration. |
java.lang.Object |
getProperty(java.lang.String arg0)
Delegates to the underlying configuration. |
short |
getShort(java.lang.String key)
Delegates to the underlying configuration. |
short |
getShort(java.lang.String key,
short defaultValue)
Delegates to the underlying configuration. |
java.lang.Short |
getShort(java.lang.String key,
java.lang.Short defaultValue)
Delegates to the underlying configuration. |
java.lang.String |
getString(java.lang.String key)
Delegates to the underlying configuration. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Delegates to the underlying configuration. |
java.lang.String[] |
getStringArray(java.lang.String key)
Delegates to the underlying configuration. |
boolean |
isEmpty()
Delegates to the underlying configuration. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Delegates to the underlying configuration. |
void |
stopPolling()
|
org.apache.commons.configuration.Configuration |
subset(java.lang.String prefix)
Delegates to the underlying configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationWithPollingSource(org.apache.commons.configuration.Configuration config, PolledConfigurationSource source, AbstractPollingScheduler scheduler)
config
- Configuration to delegate tosource
- PolledConfigurationSource
to poll get new/changed propertiesscheduler
- AbstractPollingScheduler to provide the polling scheduleMethod Detail |
---|
public final org.apache.commons.configuration.Configuration getConfiguration()
public final void stopPolling()
public void addProperty(java.lang.String key, java.lang.Object value)
addProperty
in interface org.apache.commons.configuration.Configuration
public void clear()
clear
in interface org.apache.commons.configuration.Configuration
public void clearProperty(java.lang.String key)
clearProperty
in interface org.apache.commons.configuration.Configuration
public boolean containsKey(java.lang.String arg0)
containsKey
in interface org.apache.commons.configuration.Configuration
public java.math.BigDecimal getBigDecimal(java.lang.String key, java.math.BigDecimal defaultValue)
getBigDecimal
in interface org.apache.commons.configuration.Configuration
public java.math.BigDecimal getBigDecimal(java.lang.String key)
getBigDecimal
in interface org.apache.commons.configuration.Configuration
public java.math.BigInteger getBigInteger(java.lang.String key, java.math.BigInteger defaultValue)
getBigInteger
in interface org.apache.commons.configuration.Configuration
public java.math.BigInteger getBigInteger(java.lang.String key)
getBigInteger
in interface org.apache.commons.configuration.Configuration
public boolean getBoolean(java.lang.String key, boolean defaultValue)
getBoolean
in interface org.apache.commons.configuration.Configuration
public java.lang.Boolean getBoolean(java.lang.String key, java.lang.Boolean defaultValue)
getBoolean
in interface org.apache.commons.configuration.Configuration
public boolean getBoolean(java.lang.String key)
getBoolean
in interface org.apache.commons.configuration.Configuration
public byte getByte(java.lang.String key, byte defaultValue)
getByte
in interface org.apache.commons.configuration.Configuration
public java.lang.Byte getByte(java.lang.String key, java.lang.Byte defaultValue)
getByte
in interface org.apache.commons.configuration.Configuration
public byte getByte(java.lang.String key)
getByte
in interface org.apache.commons.configuration.Configuration
public double getDouble(java.lang.String key, double defaultValue)
getDouble
in interface org.apache.commons.configuration.Configuration
public java.lang.Double getDouble(java.lang.String key, java.lang.Double defaultValue)
getDouble
in interface org.apache.commons.configuration.Configuration
public double getDouble(java.lang.String key)
getDouble
in interface org.apache.commons.configuration.Configuration
public float getFloat(java.lang.String key, float defaultValue)
getFloat
in interface org.apache.commons.configuration.Configuration
public java.lang.Float getFloat(java.lang.String key, java.lang.Float defaultValue)
getFloat
in interface org.apache.commons.configuration.Configuration
public float getFloat(java.lang.String key)
getFloat
in interface org.apache.commons.configuration.Configuration
public int getInt(java.lang.String key, int defaultValue)
getInt
in interface org.apache.commons.configuration.Configuration
public int getInt(java.lang.String key)
getInt
in interface org.apache.commons.configuration.Configuration
public java.lang.Integer getInteger(java.lang.String key, java.lang.Integer defaultValue)
getInteger
in interface org.apache.commons.configuration.Configuration
public java.util.Iterator getKeys()
getKeys
in interface org.apache.commons.configuration.Configuration
public java.util.Iterator getKeys(java.lang.String prefix)
getKeys
in interface org.apache.commons.configuration.Configuration
public java.util.List getList(java.lang.String key, java.util.List defaultValue)
getList
in interface org.apache.commons.configuration.Configuration
public java.util.List getList(java.lang.String key)
getList
in interface org.apache.commons.configuration.Configuration
public long getLong(java.lang.String key, long defaultValue)
getLong
in interface org.apache.commons.configuration.Configuration
public java.lang.Long getLong(java.lang.String key, java.lang.Long defaultValue)
getLong
in interface org.apache.commons.configuration.Configuration
public long getLong(java.lang.String key)
getLong
in interface org.apache.commons.configuration.Configuration
public java.util.Properties getProperties(java.lang.String key)
getProperties
in interface org.apache.commons.configuration.Configuration
public java.lang.Object getProperty(java.lang.String arg0)
getProperty
in interface org.apache.commons.configuration.Configuration
public short getShort(java.lang.String key, short defaultValue)
getShort
in interface org.apache.commons.configuration.Configuration
public java.lang.Short getShort(java.lang.String key, java.lang.Short defaultValue)
getShort
in interface org.apache.commons.configuration.Configuration
public short getShort(java.lang.String key)
getShort
in interface org.apache.commons.configuration.Configuration
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
getString
in interface org.apache.commons.configuration.Configuration
public java.lang.String getString(java.lang.String key)
getString
in interface org.apache.commons.configuration.Configuration
public java.lang.String[] getStringArray(java.lang.String key)
getStringArray
in interface org.apache.commons.configuration.Configuration
public boolean isEmpty()
isEmpty
in interface org.apache.commons.configuration.Configuration
public void setProperty(java.lang.String key, java.lang.Object value)
setProperty
in interface org.apache.commons.configuration.Configuration
public org.apache.commons.configuration.Configuration subset(java.lang.String prefix)
subset
in interface org.apache.commons.configuration.Configuration
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |