public class DynamicConfiguration extends ConcurrentMapConfiguration
PolledConfigurationSource
according to the schedule set by a
scheduler. The property values in this configuration will be changed dynamically at runtime if the
value changes in the configuration source.
This configuration does not allow null as key or value and will throw NullPointerException when trying to add or set properties with empty key or value.
map
Constructor and Description |
---|
DynamicConfiguration() |
DynamicConfiguration(PolledConfigurationSource source,
AbstractPollingScheduler scheduler)
Create an instance and start polling the configuration source.
|
Modifier and Type | Method and Description |
---|---|
PolledConfigurationSource |
getSource() |
protected void |
init(PolledConfigurationSource source,
AbstractPollingScheduler scheduler)
Initialize the configuration.
|
void |
startPolling(PolledConfigurationSource source,
AbstractPollingScheduler scheduler)
Start polling the configuration source with the specified scheduler.
|
void |
stopLoading()
Stops the scheduler
|
addConfigurationListener, addErrorListener, addProperty, addPropertyDirect, addPropertyImpl, clear, clearConfigurationListeners, clearErrorListeners, clearPropertyDirect, containsKey, copy, fireError, fireEvent, getConfigurationListeners, getErrorListeners, getKeys, getProperties, getProperty, isEmpty, loadProperties, removeConfigurationListener, removeErrorListener, setProperty, setPropertyImpl
addErrorLogListener, append, clearProperty, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolatedConfiguration, interpolateHelper, isDelimiterParsingDisabled, isScalarValue, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setThrowExceptionOnMissing, subset
public DynamicConfiguration(PolledConfigurationSource source, AbstractPollingScheduler scheduler)
source
- PolledConfigurationSource to pollscheduler
- AbstractPollingScheduler whose AbstractPollingScheduler.schedule(Runnable)
will be
used to determine the polling schedulepublic DynamicConfiguration()
public void startPolling(PolledConfigurationSource source, AbstractPollingScheduler scheduler)
source
- PolledConfigurationSource to pollscheduler
- AbstractPollingScheduler whose AbstractPollingScheduler.schedule(Runnable)
will be
used to determine the polling scheduleprotected void init(PolledConfigurationSource source, AbstractPollingScheduler scheduler)
DynamicConfiguration(PolledConfigurationSource, AbstractPollingScheduler)
and startPolling(PolledConfigurationSource, AbstractPollingScheduler)
before the initial polling. The default implementation does nothing.public void stopLoading()
public PolledConfigurationSource getSource()
Copyright © 2017. All Rights Reserved.