public class ConfigurationWithPollingSource
extends java.lang.Object
implements org.apache.commons.configuration.Configuration
This class can be served as a decorator to an existing configuration to make the property values dynamic.
| Constructor and Description |
|---|
ConfigurationWithPollingSource(org.apache.commons.configuration.Configuration config,
PolledConfigurationSource source,
AbstractPollingScheduler scheduler)
Create an instance and start polling the configuration source
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 schedulepublic 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.Configurationpublic void clear()
clear in interface org.apache.commons.configuration.Configurationpublic void clearProperty(java.lang.String key)
clearProperty in interface org.apache.commons.configuration.Configurationpublic boolean containsKey(java.lang.String arg0)
containsKey in interface org.apache.commons.configuration.Configurationpublic java.math.BigDecimal getBigDecimal(java.lang.String key,
java.math.BigDecimal defaultValue)
getBigDecimal in interface org.apache.commons.configuration.Configurationpublic java.math.BigDecimal getBigDecimal(java.lang.String key)
getBigDecimal in interface org.apache.commons.configuration.Configurationpublic java.math.BigInteger getBigInteger(java.lang.String key,
java.math.BigInteger defaultValue)
getBigInteger in interface org.apache.commons.configuration.Configurationpublic java.math.BigInteger getBigInteger(java.lang.String key)
getBigInteger in interface org.apache.commons.configuration.Configurationpublic boolean getBoolean(java.lang.String key,
boolean defaultValue)
getBoolean in interface org.apache.commons.configuration.Configurationpublic java.lang.Boolean getBoolean(java.lang.String key,
java.lang.Boolean defaultValue)
getBoolean in interface org.apache.commons.configuration.Configurationpublic boolean getBoolean(java.lang.String key)
getBoolean in interface org.apache.commons.configuration.Configurationpublic byte getByte(java.lang.String key,
byte defaultValue)
getByte in interface org.apache.commons.configuration.Configurationpublic java.lang.Byte getByte(java.lang.String key,
java.lang.Byte defaultValue)
getByte in interface org.apache.commons.configuration.Configurationpublic byte getByte(java.lang.String key)
getByte in interface org.apache.commons.configuration.Configurationpublic double getDouble(java.lang.String key,
double defaultValue)
getDouble in interface org.apache.commons.configuration.Configurationpublic java.lang.Double getDouble(java.lang.String key,
java.lang.Double defaultValue)
getDouble in interface org.apache.commons.configuration.Configurationpublic double getDouble(java.lang.String key)
getDouble in interface org.apache.commons.configuration.Configurationpublic float getFloat(java.lang.String key,
float defaultValue)
getFloat in interface org.apache.commons.configuration.Configurationpublic java.lang.Float getFloat(java.lang.String key,
java.lang.Float defaultValue)
getFloat in interface org.apache.commons.configuration.Configurationpublic float getFloat(java.lang.String key)
getFloat in interface org.apache.commons.configuration.Configurationpublic int getInt(java.lang.String key,
int defaultValue)
getInt in interface org.apache.commons.configuration.Configurationpublic int getInt(java.lang.String key)
getInt in interface org.apache.commons.configuration.Configurationpublic java.lang.Integer getInteger(java.lang.String key,
java.lang.Integer defaultValue)
getInteger in interface org.apache.commons.configuration.Configurationpublic java.util.Iterator getKeys()
getKeys in interface org.apache.commons.configuration.Configurationpublic java.util.Iterator getKeys(java.lang.String prefix)
getKeys in interface org.apache.commons.configuration.Configurationpublic java.util.List getList(java.lang.String key,
java.util.List defaultValue)
getList in interface org.apache.commons.configuration.Configurationpublic java.util.List getList(java.lang.String key)
getList in interface org.apache.commons.configuration.Configurationpublic long getLong(java.lang.String key,
long defaultValue)
getLong in interface org.apache.commons.configuration.Configurationpublic java.lang.Long getLong(java.lang.String key,
java.lang.Long defaultValue)
getLong in interface org.apache.commons.configuration.Configurationpublic long getLong(java.lang.String key)
getLong in interface org.apache.commons.configuration.Configurationpublic java.util.Properties getProperties(java.lang.String key)
getProperties in interface org.apache.commons.configuration.Configurationpublic java.lang.Object getProperty(java.lang.String arg0)
getProperty in interface org.apache.commons.configuration.Configurationpublic short getShort(java.lang.String key,
short defaultValue)
getShort in interface org.apache.commons.configuration.Configurationpublic java.lang.Short getShort(java.lang.String key,
java.lang.Short defaultValue)
getShort in interface org.apache.commons.configuration.Configurationpublic short getShort(java.lang.String key)
getShort in interface org.apache.commons.configuration.Configurationpublic java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
getString in interface org.apache.commons.configuration.Configurationpublic java.lang.String getString(java.lang.String key)
getString in interface org.apache.commons.configuration.Configurationpublic java.lang.String[] getStringArray(java.lang.String key)
getStringArray in interface org.apache.commons.configuration.Configurationpublic boolean isEmpty()
isEmpty in interface org.apache.commons.configuration.Configurationpublic void setProperty(java.lang.String key,
java.lang.Object value)
setProperty in interface org.apache.commons.configuration.Configurationpublic org.apache.commons.configuration.Configuration subset(java.lang.String prefix)
subset in interface org.apache.commons.configuration.Configuration