public class ObservingPropertySourceProvider extends Object implements PropertySourceProvider
PropertySourceChange
events.
The default folder is META-INF/config, but you can change using the absolute path in
"-Dtamaya.configdir" parameter.Constructor and Description |
---|
ObservingPropertySourceProvider(ConfigurationFormat... formats)
Constructor, reading the config file from classpath resource and system property.
|
ObservingPropertySourceProvider(Path directory,
ConfigurationFormat... formats)
Constructorm using an explicit directory, ignoring all kind of configuration, if set.
|
Modifier and Type | Method and Description |
---|---|
void |
directoryChanged(Path directory)
Called when a file has been modified.
|
Collection<PropertySource> |
getPropertySources() |
protected Collection<PropertySource> |
getPropertySources(ConfigurationData data) |
protected ConfigurationData |
loadFile(Path file)
Load a single file.
|
public ObservingPropertySourceProvider(ConfigurationFormat... formats)
public ObservingPropertySourceProvider(Path directory, ConfigurationFormat... formats)
directory
- the target directory. If null, the default configuration and system property are used.formats
- the formats to be used.protected Collection<PropertySource> getPropertySources(ConfigurationData data)
protected ConfigurationData loadFile(Path file)
file
- the file, not null.public void directoryChanged(Path directory)
directory
- the file path, not null.public Collection<PropertySource> getPropertySources()
getPropertySources
in interface PropertySourceProvider
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.