|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.config.source.MapConfigSource
public class MapConfigSource
Encapsulates a Map as a ConfigSource. At
construction, the source can be instructed to cache a snapshot of the map;
alternatively the source will reflect changes in the map. In either case the
supplied map may be modified after it has been supplied wrapped as a
ConfigSource in this way.
It is strongly recommended that only synchronized maps (maps that are safe
for concurrent use such as those returned by
Collections.synchronizedMap()) are used to construct sources
that are not fixed.
Instances of this class are not safe for concurrent use. Wrap instances in a SynchronousConfigSource if thread safety is required.
| Constructor Summary | |
|---|---|
MapConfigSource(java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new config source using properties from a supplied map. |
|
MapConfigSource(java.util.Map<java.lang.String,java.lang.String> properties,
boolean fixed)
Creates a new config source using properties from a supplied map. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
A map of the configuration properties supplied by this source. |
boolean |
isFixed()
Whether the values returned by this config source are fixed. |
long |
lastModified()
Returns the time at which the properties were last known to have changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapConfigSource(java.util.Map<java.lang.String,java.lang.String> properties,
boolean fixed)
properties - a map containing the properties for this config sourcefixed - true if the properties returned by this source should not
change, false otherwise.public MapConfigSource(java.util.Map<java.lang.String,java.lang.String> properties)
properties - a map containing the properties for this config source| Method Detail |
|---|
public boolean isFixed()
public long lastModified()
throws java.lang.RuntimeException
ConfigSource
lastModified in interface ConfigSourcejava.lang.RuntimeException - if the last modified timestamp could not be generated
public java.util.Map<java.lang.String,java.lang.String> getProperties()
throws java.lang.RuntimeException
ConfigSource
getProperties in interface ConfigSourcejava.lang.RuntimeException - if the properties could not be supplied
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||