Friday, August 7, 2015

osgi note

Eclipse osgi implementation changes to rely on Apache felix gogo project. So cannot start osgi console in the below way:
java -jar org.eclipse.osgi_3.10.100.v20150529-1857.jar -console
osgi prompt will not appear.
Need copy the 4 files (org.eclipse.osgi and gogo):
org.eclipse.osgi_*.jar, org.apache.felix.gogo.*.jar
Then create a configuration folder and put a file config.ini with the below content:
osgi.bundles=org.eclipse.osgi_3.10.100.v20150529-1857.jar@start,org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@start,org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@start,org.apache.felix.gogo.command_0.10.0.v201209301215.jar@start
When osgi prompt appears, type help to show the available commands.
https://isurues.wordpress.com/2009/01/01/useful-equinox-osgi-commands/

By default, none of the classes in a bundle are visible from any other bundle; inside bundles they follow the normal rules of the Java language.
So, what do you do if you want to access the classes of one bundle from another bundle?
The solution is to export packages from the source bundle and then import them into the target bundle.
The OSGi container creates a different class loader for every bundle.

No comments:

Post a Comment