Changes

Jump to: navigation, search

Teams Winter 2011/team1/OSGI/Create the Service Interface

727 bytes added, 13:07, 16 February 2011
1. Create the Service Interface
'''1.2. Create Interfaces'''<br/>
Add a package to the src folder in your project.Then Add following ttems items to your package:
# A Java class named BusRoute.
# A Java class named BusRouteNotFoundException which extends java.lang.Exceptions class.
# A Java class named InvalidNumberOfSeatsException which extends java.lang.Exception class.
# An Interface named Ticketing
:[[Image: 5CreateInterfaces.jpg| 800px]]
:Enter the code for the classes and the interface as per the following screen-shots::'''BusRout Class:''':[[Image: 6_CreateNewClass6CreateNewClass.jpg | 700px]]:'''BusRoutNotFoundException Class:''':[[Image: 77CreateNewClass.jpg | 700px]]:'''InvalidNumberOfSeatsException Class:''':[[Image: 8_CreateNewClass71CreateNewClass.jpg | 700px]]:'''Ticketing Interface:''':[[Image: 9_CreateNewClass8CreateInterface.jpg | 700px]] '''1.3. Export Package'''<br/>:[[Image: 10_ExceptionClassIn order to be able to register our service we need to export our package in the interface bundle. To do so, select MANIFEST.MF in the package explored and then brows to the Runtime tab.Click on "Add" in Exported Packages section.jpg | 700px]] :[[Image: 119ExportPackge.jpg | 700px]] :[[Image: 12_ExportPackageSelect the Ticketing package and press Ok button.JPG | 700px]]:[[Image: 1310ExportPackage.jpg | 700px400px]]:[[Image: 14_ExportPackage12ExportPackage.jpg | 700px400px]] :[[Image: 15The Interface is Exported and now it's time to build the service implementation project where you add all the implementations of the interface and register it at run time.jpg | 700px]]
1
edit

Navigation menu