The client platform includes an implementation of the OSGi Preferences service for use by OSGi-related applications.
The OSGi Preferences service implementation provided by Eclipse uses the standard Eclipse preferences service persistence mechanism for storage of preference values.
OSGi preferences are accessible only to the plug-ins that created the preference, and are associated with the bundle number of the plug-in. If the bundle number changes, the preferences will no longer be accessible. Operations such as starting the platform with the –clean
option can cause bundles to be re-numbered. For this reason, OSGi preference usage is not encouraged.
How are preferences set?
Preferences are set directly through the code, often as a result of interactions with a user.
How are default preference values set?
Default preference values are always set by the service that is defining the preferences. The service may provide alternatives for setting the default values.
How can the preference values be changed after deployment?
You can query OSGi preference values after deployment using the preferences jobs supplied by the Client Management server. Preference values for OSGi preferences are located at /configuration/org.eclipse.core.runtime.preferences.OSGiPreferences.xx
is the bundle number. See Getting an inventory of Eclipse preferences
for more information.
You can add, update, or remove project, instance and configuration preference values using the following mechanisms:
Since the storage mechanism contains some referential aspects, if a plug-in has not already created settings value, it is not recommended that you create a new OSGi preferences tree for the plug-in, but that you only modify values for the existing tree. Changes to OSGi Preference values may not be available until the next platform restart.
Parent topic: Managing client configurations