Package rs.baselib.prefs
Interface IPreferencesService
- All Known Implementing Classes:
AbstractPreferencesService,PreferencesService
public interface IPreferencesService
The preference service.
- Author:
- ralph
-
Method Summary
Modifier and Type Method Description voidflush(IPreferences node)Flushes any changes made in this node.java.util.concurrent.locks.LockgetReadLock(IPreferences node)Returns the read lock object for the given node.IPreferencesgetSystemPreferences(java.lang.String applicationName)Returns the system preferences for the given application.java.io.FilegetSystemPreferencesHome(java.lang.String applicationName)Returns the home directory for system preferences of the given application.IPreferencesgetUserPreferences(java.lang.String applicationName)Returns the user preferences for the given application.java.io.FilegetUserPreferencesHome(java.lang.String applicationName)Returns the home directory for user preferences of the given application.java.util.concurrent.locks.LockgetWriteLock(IPreferences node)Returns the write lock object for the given node.voidsync(IPreferences node)Wait for any modifications to be flushed.
-
Method Details
-
getUserPreferences
IPreferences getUserPreferences(java.lang.String applicationName) throws java.util.prefs.BackingStoreExceptionReturns the user preferences for the given application.- Parameters:
applicationName- name of application- Returns:
- the preferences object
- Throws:
java.util.prefs.BackingStoreException- when the storage fails
-
getSystemPreferences
IPreferences getSystemPreferences(java.lang.String applicationName) throws java.util.prefs.BackingStoreExceptionReturns the system preferences for the given application.- Parameters:
applicationName- name of application- Returns:
- the preferences object
- Throws:
java.util.prefs.BackingStoreException- when the storage fails
-
flush
Flushes any changes made in this node. The method does not return before the flush has been completed.- Parameters:
node- the node to be flushed- Throws:
java.util.prefs.BackingStoreException- when there has been a communication problem with the backing store.
-
sync
Wait for any modifications to be flushed. The method does not return before the next flush has been completed (in case modifications are pending).- Parameters:
node- the node to be flushed- Throws:
java.util.prefs.BackingStoreException- when there has been a communication problem with the backing store.
-
getReadLock
Returns the read lock object for the given node.- Parameters:
node- the node that requires a read lock- Returns:
- the responsible
Lockobject
-
getWriteLock
Returns the write lock object for the given node.- Parameters:
node- the node that requires a write lock- Returns:
- the responsible
Lockobject
-
getUserPreferencesHome
java.io.File getUserPreferencesHome(java.lang.String applicationName)Returns the home directory for user preferences of the given application.- Parameters:
applicationName- name of application- Returns:
- user preferences home
-
getSystemPreferencesHome
java.io.File getSystemPreferencesHome(java.lang.String applicationName)Returns the home directory for system preferences of the given application.- Parameters:
applicationName- name of application- Returns:
- system preferences home
-