Step 5: Launching the Vendor Application

In this step the application will be launched from within the Eclipse IDE and tested using the OSGi console.

  1. Select Run > Run... to open the Run dialog.
  2. Create a new launch configuration by right clicking Equinox OSGi Framework on the left of the dialog and choosing New from the context menu.
  3. Enter a name for this launch in the Name field, such as "SAT Tutorial".
  4. On the Plug-ins page, uncheck both the Workspace Plug-ins checkbox and the Target Platform checkbox. This deselects all the bundles, which is a good place to start.
  5. Under Workspace Plug-ins check the checkboxes to the left of the projects we developed during the tutorial:
  6. Now click click the Add Required Plug-ins button. You should now have the additional Target Platform bundles checked that are required for a successful launch.
  7. Create plug-in project

  8. Click the Validate Plug-in Set button to validate that the set of bundles fulfill all the necessary package dependencies.
  9. While not absolutely necessary, but still recommended, uncheck the Add new workspace plug-ins to this launch configuration automatically checkbox since this will prevent your launch configuration from changing as you add new projects to your workspace.
  10. Turn to the Settings page and check the Clear the configuration are before launching checkbox. This is highly recommended since it ensures that every time you launch the application the OSGi persistent store will be recreated, removing the chance of a previous version of you code being persisted and interfering with your testing.
  11. Create plug-in project

  12. Click the Run button to launch the Equinox OSGi Framework with the tutorial bundles installed and started.
  13. In the Eclipse Console view you will see the output from the application as well as the osgi> prompt at which you can type a variety of commands to control the framework and the installed bundles.
  14. OSGi Console

  15. As the Console shows, our application is working and the org.eclipse.soda.sat.tutorial.customer bundle has acquired the VendorService registered by the org.eclipse.soda.sat.tutorial.vendor.hotdog bundle and has bought a Ball Park hotdog.
  16. The command help will list all available commands.
  17. osgi> help
    ---Eclipse Runtime commands.---
    	diag - Displays unsatisfied constraints for the specified bundle(s).
    	active - Displays a list of all bundles currently in the ACTIVE state.
    	getprop { name } - Displays the system properties with the given name, or all of them.
    Valid commands:
    ---Controlling the OSGi framework---
    	launch - start the OSGi Framework
    	shutdown - shutdown the OSGi Framework
    	close - shutdown and exit
    	exit - exit immediately (System.exit)
    	gc - perform a garbage collection
    	init - uninstall all bundles
    	setprop = - set the OSGi property
    ---Controlling Bundles---
    	install - install and optionally start bundle from the given URL
    	uninstall - uninstall the specified bundle(s)
    	start - start the specified bundle(s)
    	stop - stop the specified bundle(s)
    	refresh - refresh the packages of the specified bundles
    	update - update the specified bundle(s)
    ---Displaying Status---
    	status - display installed bundles and registered services
    	ss - display installed bundles (short status)
    	services {filter} - display registered service details
    	packages {||} - display imported/exported package details
    	bundles - display details for all installed bundles
    	bundle (|) - display details for the specified bundle(s)
    	headers (|) - print bundle headers
    	log (|) - display log entries
    ---Extras---
    	exec  - execute a command in a separate process and wait
    	fork  - execute a command in a separate process
    ---Controlling Start Level---
    	sl {(|)} - display the start level for the specified bundle, or for the framework if no bundle specified
    	setfwsl  - set the framework start level
    	setbsl  (|) - set the start level for the bundle(s)
    	setibsl  - set the initial bundle start level
    ------Controlling the Profiling------
    	profilelog - Display & flush the profile log messages
    
    ---Controlling the Console---
    	more - More prompt for console output