KnisterPeter/osgi-kernel — pull request #10 by sebako (2013-04-10 14:29:20+00:00)
Title: Command line facility to specify system packages

Unitl now, the kernel hardwires the OSGI configuration property for extra packages to be exported from the system bundle – org.osgi.framework.system.packages.extra – to include a single package. I've found the need to include more packages, and I think it would be most appropriate to allow the user to supply a list of extra system packages on the command line, similar to how other OSGI framework launchers do it.

For convenience, the user should be able to:

1. supply a list of system packages directly, or
2. specify a text file that contains the list of package names.

I've implemented such a mechanism on this branch, providing the command line parameters `system-packages` and `system-packages-file`, to be used as follows.

A comma-separated list may be directly given on the command line:

java -jar kernel.jar -system-packages=sun.misc,com.sun.jndi.ldap

A list may be supplied in a file:

java -jar kernel.jar -system-packages-file=syspack.txt

Each line of the file is interpreted as a package name; except that the file may contain empty and comment lines; see the comments in the Java source for details on that.

Incidentally both parameters can occur on the command line, and multiple times, and all packages add up to the final list that gets set in the framework configuration map. Duplicate entries are eliminated.