|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.config.source.PreferencesConfigSource
public class PreferencesConfigSource
A configuration source which draws its properties from a
Preferences node. As per the ConfigSource
interface, all properties are exposed as strings. The properties of
descendant preference nodes are represented in the property map under the dot
delimited combination of the descendant node names and the property name.
If the startListening() method is called, the source will
monitor the preferences for changes until the stopListening()
method is called. Note that, as per the Preference API specification, changes
to preferences will typically need to be flushed before events that this
object can observe will be reported.
This source is safe for multithreaded use.
| Constructor Summary | |
|---|---|
PreferencesConfigSource(java.util.prefs.Preferences preferences)
Create a configuration source which draws its properties from the supplied preferences node. |
|
| Method Summary | |
|---|---|
java.util.prefs.Preferences |
getPreferences()
The preferences which are used to generate the properties for this source. |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
The properties obtained from the preferences node. |
long |
lastModified()
The time at which the properties returned by this property source, were last known to have changed. |
void |
startListening()
Causes this source to start listening for property changes and node changes to the preference node. |
void |
stopListening()
Causes this source to stop listening for changes to the property values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PreferencesConfigSource(java.util.prefs.Preferences preferences)
preferences - a node containing configuration information, not null| Method Detail |
|---|
public long lastModified()
throws ProntoConfigException
lastModified in interface ConfigSourceProntoConfigException - if an exception occurs accessing the preferences backing
store.
public java.util.Map<java.lang.String,java.lang.String> getProperties()
throws ProntoConfigException
getProperties in interface ConfigSourceProntoConfigException - if an exception occurs accessing the preferences backing
store.public java.util.prefs.Preferences getPreferences()
public void startListening()
throws ProntoConfigException
ProntoConfigException - if an exception occurs accessing the preferences backing
store.
public void stopListening()
throws ProntoConfigException
ProntoConfigException - if an exception occurs accessing the preferences backing
store.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||