| java.lang.Object org.fao.geonet.kernel.setting.SettingManager
SettingManager | public class SettingManager (Code) | | Allows hierarchical management of application settings. The settings API
has been designed with the following goals:
- speed: all the settings tree is kept into memory
- transactional: changes follow the rules of transactions. The only issue
is that changes are not visible until commit. If a thread
changes a value and then reads it, the thread gets the old
value. Added settings will not be visible and removed ones
will still be visible until commit.
- concurrent: many thread can access the settings API at the same time. A
read/write lock is used to arbitrate threads
Multiple removes: there are no issues. If thread A removes a subtree S1 and
another thread B removes a subtree S2 inside S1, the first thread to commit
succeeds while the second always rises a 'cannot serializable exception'.
In any commit combination, the settings integrity is maintained.
Tree structure:
+ system
| + options
| + useProxy
| + host
| + port
|
+ harvesting
|
Constructor Summary | |
public | SettingManager(Dbms dbms, ProviderManager provMan) |
Method Summary | |
public String | add(Dbms dbms, String path, Object name, Object value) | public Element | get(String path, int level) | public String | getValue(String path) | public boolean | getValueAsBool(String path, boolean defValue) | public boolean | getValueAsBool(String path) | public Integer | getValueAsInt(String path) | public boolean | remove(Dbms dbms, String path) | public boolean | removeChildren(Dbms dbms, String path) | public boolean | setName(Dbms dbms, String path, String name) | public boolean | setValue(Dbms dbms, String path, Object value) | public boolean | setValues(Dbms dbms, Map<String, Object> values) |
SettingManager | public SettingManager(Dbms dbms, ProviderManager provMan) throws SQLException(Code) | | |
getValueAsBool | public boolean getValueAsBool(String path, boolean defValue)(Code) | | |
getValueAsBool | public boolean getValueAsBool(String path)(Code) | | |
|
|