Difference between revisions of "Teams Winter 2011/team1/OSGI/Create the Service Interface"
Ladanzahir (talk | contribs) (→1. Create the Service Interface) |
Ladanzahir (talk | contribs) (→1. Create the Service Interface) |
||
Line 21: | Line 21: | ||
:Enter the code for the classes and the interface as per the following screenshots: | :Enter the code for the classes and the interface as per the following screenshots: | ||
− | + | :'''BusRout Class:''' | |
:[[Image: 6CreateNewClass.jpg | 700px]] | :[[Image: 6CreateNewClass.jpg | 700px]] | ||
+ | :'''BusRoutNotFoundException class''' | ||
:[[Image: 7.jpg | 700px]] | :[[Image: 7.jpg | 700px]] | ||
+ | :'''Ticketing Interface''' | ||
:[[Image: 8_CreateNewClass.jpg | 700px]] | :[[Image: 8_CreateNewClass.jpg | 700px]] | ||
:[[Image: 9_CreateNewClass.jpg | 700px]] | :[[Image: 9_CreateNewClass.jpg | 700px]] |
Revision as of 17:37, 14 February 2011
1. Create the Service Interface
- First thing to do in building an OSGI application is to define the service interface so that the developer who creates the GUI part of application knows what services will be available, and what are their requirements and outcome.In order to do this please follow these steps:
1.1. Create the interface bundle
- Create a new Plug-in project in eclipse using File>New> Plug-in Project:
- Give it a proper name and Choose the target platform to be an OSGI platform:
- Make sure you check off the , so that no Activator class is created in the project (this bundel is just interfaces so it does not run).
1.2. Create Interfaces
Add a package to the src folder in your project.Then Add following ttems to your package:
- A Java class named BusRoute.
- A Java class named BusRouteNotFoundException which extends java.lang.Exceptions class.
- An Interface named Ticketing