Difference between revisions of "Teams Winter 2011/team1/OSGI/Implement the Service Provider"
(→2. Implement the Service Provider) |
(→2. Implement the Service Provider) |
||
Line 1: | Line 1: | ||
=== 2. Implement the Service Provider === | === 2. Implement the Service Provider === | ||
'''2.1. Create the provider bundle''' | '''2.1. Create the provider bundle''' | ||
− | : The process of creating the bundle is almost the same as interface bundle. Here we just need an activator to register the bundle. | + | : The process of creating the bundle is almost the same as interface bundle. Here we just need an activator to register the bundle. So, when creating the new plug-in project, make sure to leave the Activator checked: |
− | So, when creating the new plug-in project, make sure to leave the Activator checked: | + | :[[Image: createProvider.jpg | 600px]] |
− | :[[Image: createProvider.jpg | | ||
'''2.2. Register the service in the class Activator''' | '''2.2. Register the service in the class Activator''' | ||
: Here is the implementation of the Activator class for registering the service: | : Here is the implementation of the Activator class for registering the service: | ||
− | [[Image: providerActivator.jpg | | + | :[[Image: providerActivator.jpg | 600px]] |
'''2.2. Define the MANIFEST.MF for the service provider bundle.''' | '''2.2. Define the MANIFEST.MF for the service provider bundle.''' | ||
: In the manifest that is created during the process of creating the bundle, we need to import the service package. | : In the manifest that is created during the process of creating the bundle, we need to import the service package. | ||
: Click on the ''MANIFEST.MF'' - > select the ''Dependencies'' tab -> click on ''Add'' to ''import'' a package: | : Click on the ''MANIFEST.MF'' - > select the ''Dependencies'' tab -> click on ''Add'' to ''import'' a package: | ||
− | [[Image: providerImport1.jpg | | + | :[[Image: providerImport1.jpg | 600px]] |
: Type in the name of the package of your interface. After it was selected click ok: | : Type in the name of the package of your interface. After it was selected click ok: | ||
− | [[Image: providerImport2.jpg | | + | :[[Image: providerImport2.jpg | 600px]] |
'''2.3. Install and run the Service Provider Bundle''' | '''2.3. Install and run the Service Provider Bundle''' | ||
: | : |
Revision as of 19:24, 13 February 2011
2. Implement the Service Provider
2.1. Create the provider bundle
- The process of creating the bundle is almost the same as interface bundle. Here we just need an activator to register the bundle. So, when creating the new plug-in project, make sure to leave the Activator checked:
2.2. Register the service in the class Activator
2.2. Define the MANIFEST.MF for the service provider bundle.
- In the manifest that is created during the process of creating the bundle, we need to import the service package.
- Click on the MANIFEST.MF - > select the Dependencies tab -> click on Add to import a package:
- Type in the name of the package of your interface. After it was selected click ok:
2.3. Install and run the Service Provider Bundle