Difference between revisions of "Teams Winter 2011/team4/lab2"

From CDOT Wiki
Jump to: navigation, search
(Create the Service Interface)
(Create the Service Interface)
Line 10: Line 10:
 
* We now need to create a new plugin project, to do so do the following: File->New->Plug-in Project
 
* We now need to create a new plugin project, to do so do the following: File->New->Plug-in Project
 
* After selecting Plug-in Project from the options, give the Project a name according to the lab structure defined in the previous tutorial (cs.ecl.lab.<name here>
 
* After selecting Plug-in Project from the options, give the Project a name according to the lab structure defined in the previous tutorial (cs.ecl.lab.<name here>
 +
[[File:T4L2-1.png]]
 
* After doing so, click next, where you will be presented with a screen that provides you with the project ID, version, name, ect.  There will be an options section at the bottom of the window, be sure to unclick generate an activator, as it is not needed for the lab as the bundel is just interfaces and it is not run
 
* After doing so, click next, where you will be presented with a screen that provides you with the project ID, version, name, ect.  There will be an options section at the bottom of the window, be sure to unclick generate an activator, as it is not needed for the lab as the bundel is just interfaces and it is not run
 
* You will now be presented with a screen that looks like the following:
 
* You will now be presented with a screen that looks like the following:
 +
[[File:T4L2-2.png]]
 
====Creating the Interface====
 
====Creating the Interface====
 
* We will now add a package to the src folder of our project.  Once you have done this you will add a class TimeZones and an Interface name Times to your package.
 
* We will now add a package to the src folder of our project.  Once you have done this you will add a class TimeZones and an Interface name Times to your package.
 
* Enter code in both TimeZones and Times according to the following:
 
* Enter code in both TimeZones and Times according to the following:
 +
[[File:T4L2-3.png]]
 +
[[File:T4L2-5.png]]
 
* If we want to use our package, we must export it in the interface bundle.  First select MANIFEST.MF, then click on the runtime tab, and select "Add", then select your package. (Refer to Image below)
 
* If we want to use our package, we must export it in the interface bundle.  First select MANIFEST.MF, then click on the runtime tab, and select "Add", then select your package. (Refer to Image below)
 +
[[File:T4L2-4.png]]
 
* Congratulations! You have successfully exported your package and we are ready to move onto step 2, implementing the Service Provider.
 
* Congratulations! You have successfully exported your package and we are ready to move onto step 2, implementing the Service Provider.
  

Revision as of 19:28, 16 February 2011

Lab 2


Tutorial

Create the Service Interface

Define the service interface

  • First download Eclipse Classic from here

Create the Interface Bundle

  • We now need to create a new plugin project, to do so do the following: File->New->Plug-in Project
  • After selecting Plug-in Project from the options, give the Project a name according to the lab structure defined in the previous tutorial (cs.ecl.lab.<name here>

T4L2-1.png

  • After doing so, click next, where you will be presented with a screen that provides you with the project ID, version, name, ect. There will be an options section at the bottom of the window, be sure to unclick generate an activator, as it is not needed for the lab as the bundel is just interfaces and it is not run
  • You will now be presented with a screen that looks like the following:

T4L2-2.png

Creating the Interface

  • We will now add a package to the src folder of our project. Once you have done this you will add a class TimeZones and an Interface name Times to your package.
  • Enter code in both TimeZones and Times according to the following:

T4L2-3.png T4L2-5.png

  • If we want to use our package, we must export it in the interface bundle. First select MANIFEST.MF, then click on the runtime tab, and select "Add", then select your package. (Refer to Image below)

T4L2-4.png

  • Congratulations! You have successfully exported your package and we are ready to move onto step 2, implementing the Service Provider.

Implement the Service Provider

Register the service in the class Activator

Define the MANIFEST.MF for the service provider bundle

Install and run the Service Provider Bundle

Implement the Service Consumer

Define the MANIFEST.MF for the service consumer bundle

Use the class Activator to find the service

Implement a class where one can consume the service

Install and run the Service Consumer Bundle