Class PreferencesStore

All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager

This component provides a store for an application’s configuration backed by the Java Preferences.

Preferences are maps of key value pairs that are associated with a path. A common base path is passed to the component on creation. The application’s configuration information is stored using paths relative to that base path.

The component reads the initial values from the Java Preferences tree denoted by the base path. During application bootstrap, it intercepts the Start event using a handler with priority 999999. When receiving this event, it fires all known preferences values on the channels of the start event as a InitialPreferences event, using a new EventPipeline and waiting for its completion. Then, allows the intercepted Start event to continue.

Components that depend on configuration values define handlers for ConfigurationUpdate events and adapt themselves to the values received. Note that due to the intercepted Start event, the initial preferences values are received before the Start event, so components’ configurations can be rearranged before they actually start doing something.

Besides initially publishing the stored preferences values, the component also listens for ConfigurationUpdate events on its channel and updates the preferences store (may be suppressed).