net.sourceforge.hiveutils.service
Interface PreferencesManager

All Known Implementing Classes:
PreferencesManagerImpl, PreferencesManagerImpl

public interface PreferencesManager

Service that can read and write preferences as beans. It uses Java 1.4 preferences API.

Each preference is identified by a name and configured in hiveutils.Preferences configuration point.

Author:
Jean-Francois Poilpret

Method Summary
 java.lang.Object read(java.lang.String name)
          Read preferences as a bean.
 void write(java.lang.String name)
          Require to write a bean to preferences store.
 

Method Detail

read

java.lang.Object read(java.lang.String name)
Read preferences as a bean. Any modification to the returned bean will be saved back to the preference store at shutdown time.

Parameters:
name - unique name of the preferences bean to read
Returns:
the bean retrieved from preferences, or a default instance if it does not exists in the preferences store yet; null if name is not configured in hiveutils.Preferences.

write

void write(java.lang.String name)
Require to write a bean to preferences store. If an event Channel has been registered for that bean, then an event will be sent to that Channel.

Parameters:
name - unique name of the preferences bean to write