public class ObservingPropertySourceProvider extends Object implements PropertySourceProvider
PropertySourceChange
events.
The default folder is META-INF/config, but you can change it via an absolute path in the
"-Dtamaya.configdir" parameter.EMPTY
Constructor and Description |
---|
ObservingPropertySourceProvider(Path directory)
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(Path file)
Read property sources from the given file.
|
protected static Map<String,String> |
readProperties(Path file)
Load a single file.
|
public ObservingPropertySourceProvider(Path directory)
directory
- the target directory. If null, the default configuration and system property are used.protected Collection<PropertySource> getPropertySources(Path file)
file
- source of the property sources.protected static Map<String,String> readProperties(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–2016 Apache Software Foundation. All rights reserved.