Free tutorials for Java, Eclipse and Web programming



Follow me on twitter

3. OSGI console

We will later use the OSGI console. This console is like a MS-DOS prompt. In this console you can type command to perform certain OSGI actions. For following is a reference of OSGi commands.

Use for example the command ss to get an overview of all bundles and their status.

Table 1. OSGi commands

CommandDesription
helpLists the available commmands.
ssGives you an overview of the installed bundles and their status.
ss vogellaGives you an overview of the bundles and their status if they have vogella within their name.
start idStarts the bundle with id
stop idStops the bundle with id
install URLInstalls a bundles from an URL
uninstall idUninstalls the bundle with id
bundle "bundleid"" Show information about the bundle, including the registered and used services.
services filter Show all available services and their consumer. Filter is an optional LDAP filter, e.g. to see all services use "services (objectclass=*ManagedService)".

Bundles can be identified via their id which is displayed by the command ss.

You can also access the OSGi console of your running Eclipse IDE . In the "Console" of your running Eclipse you find a menu entry with the tooltip "Open Console". If you select here "Host OSGi Console" you have access to your running OSGi instance. To see all available commands in the OSGi console type "help".