public class ConfigurationWithPollingSource extends 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(String key,
Object value)
Delegates to the underlying configuration.
|
void |
clear()
Delegates to the underlying configuration.
|
void |
clearProperty(String key)
Delegates to the underlying configuration.
|
boolean |
containsKey(String arg0)
Delegates to the underlying configuration.
|
BigDecimal |
getBigDecimal(String key)
Delegates to the underlying configuration.
|
BigDecimal |
getBigDecimal(String key,
BigDecimal defaultValue)
Delegates to the underlying configuration.
|
BigInteger |
getBigInteger(String key)
Delegates to the underlying configuration.
|
BigInteger |
getBigInteger(String key,
BigInteger defaultValue)
Delegates to the underlying configuration.
|
boolean |
getBoolean(String key)
Delegates to the underlying configuration.
|
boolean |
getBoolean(String key,
boolean defaultValue)
Delegates to the underlying configuration.
|
Boolean |
getBoolean(String key,
Boolean defaultValue)
Delegates to the underlying configuration.
|
byte |
getByte(String key)
Delegates to the underlying configuration.
|
byte |
getByte(String key,
byte defaultValue)
Delegates to the underlying configuration.
|
Byte |
getByte(String key,
Byte defaultValue)
Delegates to the underlying configuration.
|
org.apache.commons.configuration.Configuration |
getConfiguration() |
double |
getDouble(String key)
Delegates to the underlying configuration.
|
double |
getDouble(String key,
double defaultValue)
Delegates to the underlying configuration.
|
Double |
getDouble(String key,
Double defaultValue)
Delegates to the underlying configuration.
|
float |
getFloat(String key)
Delegates to the underlying configuration.
|
float |
getFloat(String key,
float defaultValue)
Delegates to the underlying configuration.
|
Float |
getFloat(String key,
Float defaultValue)
Delegates to the underlying configuration.
|
int |
getInt(String key)
Delegates to the underlying configuration.
|
int |
getInt(String key,
int defaultValue)
Delegates to the underlying configuration.
|
Integer |
getInteger(String key,
Integer defaultValue)
Delegates to the underlying configuration.
|
Iterator |
getKeys()
Delegates to the underlying configuration.
|
Iterator |
getKeys(String prefix)
Delegates to the underlying configuration.
|
List |
getList(String key)
Delegates to the underlying configuration.
|
List |
getList(String key,
List defaultValue)
Delegates to the underlying configuration.
|
long |
getLong(String key)
Delegates to the underlying configuration.
|
long |
getLong(String key,
long defaultValue)
Delegates to the underlying configuration.
|
Long |
getLong(String key,
Long defaultValue)
Delegates to the underlying configuration.
|
Properties |
getProperties(String key)
Delegates to the underlying configuration.
|
Object |
getProperty(String arg0)
Delegates to the underlying configuration.
|
short |
getShort(String key)
Delegates to the underlying configuration.
|
short |
getShort(String key,
short defaultValue)
Delegates to the underlying configuration.
|
Short |
getShort(String key,
Short defaultValue)
Delegates to the underlying configuration.
|
String |
getString(String key)
Delegates to the underlying configuration.
|
String |
getString(String key,
String defaultValue)
Delegates to the underlying configuration.
|
String[] |
getStringArray(String key)
Delegates to the underlying configuration.
|
boolean |
isEmpty()
Delegates to the underlying configuration.
|
void |
setProperty(String key,
Object value)
Delegates to the underlying configuration.
|
void |
stopPolling() |
org.apache.commons.configuration.Configuration |
subset(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(String key, Object value)
addProperty
in interface org.apache.commons.configuration.Configuration
public void clear()
clear
in interface org.apache.commons.configuration.Configuration
public void clearProperty(String key)
clearProperty
in interface org.apache.commons.configuration.Configuration
public boolean containsKey(String arg0)
containsKey
in interface org.apache.commons.configuration.Configuration
public BigDecimal getBigDecimal(String key, BigDecimal defaultValue)
getBigDecimal
in interface org.apache.commons.configuration.Configuration
public BigDecimal getBigDecimal(String key)
getBigDecimal
in interface org.apache.commons.configuration.Configuration
public BigInteger getBigInteger(String key, BigInteger defaultValue)
getBigInteger
in interface org.apache.commons.configuration.Configuration
public BigInteger getBigInteger(String key)
getBigInteger
in interface org.apache.commons.configuration.Configuration
public boolean getBoolean(String key, boolean defaultValue)
getBoolean
in interface org.apache.commons.configuration.Configuration
public Boolean getBoolean(String key, Boolean defaultValue)
getBoolean
in interface org.apache.commons.configuration.Configuration
public boolean getBoolean(String key)
getBoolean
in interface org.apache.commons.configuration.Configuration
public byte getByte(String key, byte defaultValue)
getByte
in interface org.apache.commons.configuration.Configuration
public Byte getByte(String key, Byte defaultValue)
getByte
in interface org.apache.commons.configuration.Configuration
public byte getByte(String key)
getByte
in interface org.apache.commons.configuration.Configuration
public double getDouble(String key, double defaultValue)
getDouble
in interface org.apache.commons.configuration.Configuration
public Double getDouble(String key, Double defaultValue)
getDouble
in interface org.apache.commons.configuration.Configuration
public double getDouble(String key)
getDouble
in interface org.apache.commons.configuration.Configuration
public float getFloat(String key, float defaultValue)
getFloat
in interface org.apache.commons.configuration.Configuration
public Float getFloat(String key, Float defaultValue)
getFloat
in interface org.apache.commons.configuration.Configuration
public float getFloat(String key)
getFloat
in interface org.apache.commons.configuration.Configuration
public int getInt(String key, int defaultValue)
getInt
in interface org.apache.commons.configuration.Configuration
public int getInt(String key)
getInt
in interface org.apache.commons.configuration.Configuration
public Integer getInteger(String key, Integer defaultValue)
getInteger
in interface org.apache.commons.configuration.Configuration
public Iterator getKeys()
getKeys
in interface org.apache.commons.configuration.Configuration
public Iterator getKeys(String prefix)
getKeys
in interface org.apache.commons.configuration.Configuration
public List getList(String key, List defaultValue)
getList
in interface org.apache.commons.configuration.Configuration
public List getList(String key)
getList
in interface org.apache.commons.configuration.Configuration
public long getLong(String key, long defaultValue)
getLong
in interface org.apache.commons.configuration.Configuration
public Long getLong(String key, Long defaultValue)
getLong
in interface org.apache.commons.configuration.Configuration
public long getLong(String key)
getLong
in interface org.apache.commons.configuration.Configuration
public Properties getProperties(String key)
getProperties
in interface org.apache.commons.configuration.Configuration
public Object getProperty(String arg0)
getProperty
in interface org.apache.commons.configuration.Configuration
public short getShort(String key, short defaultValue)
getShort
in interface org.apache.commons.configuration.Configuration
public Short getShort(String key, Short defaultValue)
getShort
in interface org.apache.commons.configuration.Configuration
public short getShort(String key)
getShort
in interface org.apache.commons.configuration.Configuration
public String getString(String key, String defaultValue)
getString
in interface org.apache.commons.configuration.Configuration
public String getString(String key)
getString
in interface org.apache.commons.configuration.Configuration
public String[] getStringArray(String key)
getStringArray
in interface org.apache.commons.configuration.Configuration
public boolean isEmpty()
isEmpty
in interface org.apache.commons.configuration.Configuration
public void setProperty(String key, Object value)
setProperty
in interface org.apache.commons.configuration.Configuration
public org.apache.commons.configuration.Configuration subset(String prefix)
subset
in interface org.apache.commons.configuration.Configuration
Copyright © 2015. All Rights Reserved.