Download as a PDF

Transcript
4.5. Wisspr-wide Configuration
37
Figure 4.2: Top-level menu of the Web interface
4.5
Wisspr-wide Configuration
Another common mechanism used by all Wisspr bundles is the configuration mechanism.
Bundles often need some configuration options in order to work or to be customized (e.g.
ports or paths to files), it makes sense to offer this functionality Wisspr -wide. Wisspr uses a
configuration file in the user’s home directory to store the configuration options (as name-value
pairs). All configuration options whose name starts with run-time. can be adapted at runtime. The Web interface features a configuration page for this purpose where the options can
be changed (see figure 4.3 at the top).
Figure 4.3: Configuration page of the Web interface
In order for properties that can be changed at run-time to be useful, bundle classes must be
able to get notified about a change in the value. The configuration mechanism exactly allows
this. Classes can implement a listener interface and register it for a specific configuration
option. As soon as the option is changed, the listener method (see listing 4.5) is called and the