Previous Topic

Next Topic

Book Contents

Book Index

Working with system properties

Following is a description on setting and getting the system properties related to the operation of the framework.

Background

System properties can be classified in four categories:

Setting system properties

Prior to framework startup

The following methods for setting system properties are convenient for both system properties of the framework and system properties of the active bundles. In addition, the state of system properties will survive across framework restarts.

At framework runtime

This approach is convenient for system properties of bundles. If system properties of an active bundle are changed, restart this bundles for the changes to apply. The state of the properties specified in this way will be lost on a framework restart. To modify a system property at runtime, in the framework's text console (command prompt or Telnet) invoke the set command:

set mbs.output=remote

set mbs.output.remote.host=192.168.244.18

set mbs.output.remote.port=2020

Aggregating system property values

As previously discussed above, in the case of setting system properties in property files, the value of a system property being present across several files is taken from the last file in the relevant path setting. To aggregate the values of a certain property defined in more than one property file, add the property name to the system property mbs.sysPropsToUnite separating it with "," from the other entries. By default, the values of the mbs.syspackagesorg.osgi.framework.system.packages and org.osgi.framework.bootdelegation are aggregated. To have effect the mbs.sysPropsToUnite system property has to be added to the command line for OSGi framework startup. If you are using the bin/vms/<vm_name>/server script to start the OSGi Runtime, this can be done by adding the following to the VM_ARGS environment variable.

-Dmbs.sysPropsToUnite=<system properties to be aggregated>

Getting system properties

You can view system properties by using: