|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.config.source.CompositeConfigSource
public class CompositeConfigSource
This class provides a simple way of combining the properties from two configuration sources into one. This implementation is thread-safe iff both original sources are threadsafe. Changes to the properties of either original source will be immediately reflected in the properties returned by this source.
To combine more than two configuration sources consider chaining multiple instances of this class.
| Constructor Summary | |
|---|---|
CompositeConfigSource(ConfigSource primarySource,
ConfigSource secondarySource)
Constructs a new composite configuration source from two existing sources. |
|
| Method Summary | |
|---|---|
ConfigSource |
getPrimarySource()
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Returns the union of the properties from both underlying sources. |
ConfigSource |
getSecondarySource()
|
long |
lastModified()
Returns the latest time at which either of the underlying configuration sources was last modified. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeConfigSource(ConfigSource primarySource,
ConfigSource secondarySource)
primarySource - the primary source of configuration properties, not nullsecondarySource - the secondary source of configuration properties, not null| Method Detail |
|---|
public ConfigSource getPrimarySource()
public ConfigSource getSecondarySource()
public long lastModified()
throws java.lang.RuntimeException
lastModified in interface ConfigSourcejava.lang.RuntimeException - if either underlying source throws a RuntimeException
public java.util.Map<java.lang.String,java.lang.String> getProperties()
throws java.lang.RuntimeException
getProperties in interface ConfigSourcejava.lang.RuntimeException - if either underlying source throws a RuntimeException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||