Interface IPreferencesService

All Known Implementing Classes:
AbstractPreferencesService, PreferencesService

public interface IPreferencesService
The preference service.
Author:
ralph
  • Method Summary

    Modifier and Type Method Description
    void flush​(IPreferences node)
    Flushes any changes made in this node.
    java.util.concurrent.locks.Lock getReadLock​(IPreferences node)
    Returns the read lock object for the given node.
    IPreferences getSystemPreferences​(java.lang.String applicationName)
    Returns the system preferences for the given application.
    java.io.File getSystemPreferencesHome​(java.lang.String applicationName)
    Returns the home directory for system preferences of the given application.
    IPreferences getUserPreferences​(java.lang.String applicationName)
    Returns the user preferences for the given application.
    java.io.File getUserPreferencesHome​(java.lang.String applicationName)
    Returns the home directory for user preferences of the given application.
    java.util.concurrent.locks.Lock getWriteLock​(IPreferences node)
    Returns the write lock object for the given node.
    void sync​(IPreferences node)
    Wait for any modifications to be flushed.
  • Method Details

    • getUserPreferences

      IPreferences getUserPreferences​(java.lang.String applicationName) throws java.util.prefs.BackingStoreException
      Returns 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.BackingStoreException
      Returns 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

      void flush​(IPreferences node) throws java.util.prefs.BackingStoreException
      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

      void sync​(IPreferences node) throws java.util.prefs.BackingStoreException
      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

      java.util.concurrent.locks.Lock getReadLock​(IPreferences node)
      Returns the read lock object for the given node.
      Parameters:
      node - the node that requires a read lock
      Returns:
      the responsible Lock object
    • getWriteLock

      java.util.concurrent.locks.Lock getWriteLock​(IPreferences node)
      Returns the write lock object for the given node.
      Parameters:
      node - the node that requires a write lock
      Returns:
      the responsible Lock object
    • 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