Changes

Jump to: navigation, search

Teams Winter 2011/team4/lab2

133 bytes added, 22:35, 16 February 2011
Implement the Service Provider
* Essentially, the strating steps to creating the service provider are almost identical to the starting steps of creating the service interface
* The only difference here is after creating your plugin project (refer to previous steps for how-to) before clicking finish this time you '''MUST''' make sure generate an activator is checked, as we will need it this time.
===Define the MANIFEST.MF for the service provider bundle===
* By selecting generate activator, when Eclipse creates your plugin, it also creates an activator class which is used to handle the lifecycle of the plug-in and provides access to both the underlying OSGi system and the content of the plug-in.
[[File:T4L2-6.png]]
* In the previous step we exported our package for later use, it is now time to import this package. To do so, click on your MANIFEST.MF file, select the dependencies tab, and under the the right heading Imported Packages, select the add button (refer to picture below)
[[File:T4L2-7.png]]
* Like before, enter the name of your package and select ok.
===Run Install and run the Service Provider Bundle===
* It is now time to run the service provider bundle we have created
* Right click on your MANIFEST.MF and select Run As->Run Configuration
* Now RIght click OSGi Framework and select New
* Your workspace should now be populated with numerous options
[[File:T4L2-8.png]]
* Uncheck target platform (by default it is selected) then click Add required bundles, and then click the checkbox Only show selected
* Your workspace should look similar to this:
* Now click Run in the bottom right of your workspace, if everything went correctly, you will see a message saying '''osgi> TimeZones System Registered !'''
1
edit

Navigation menu