Difference between revisions of "OSGi : Lab Fall2011"

From CDOT Wiki
Jump to: navigation, search
(Fall 11 - Lab 1)
Line 2: Line 2:
  
 
1. Create a Swing application [https://cs.senecac.on.ca/~jordan.anastasiade/ECL/CourseContent/L2/Code/X.zip (Java code)]
 
1. Create a Swing application [https://cs.senecac.on.ca/~jordan.anastasiade/ECL/CourseContent/L2/Code/X.zip (Java code)]
 +
This is a Eclipse Java project. For this step, there is nothing special to be mentioned.
  
 
2. Develop a bundle that uses the Swing and export its packages  
 
2. Develop a bundle that uses the Swing and export its packages  
 
(this bundle does NOT need an activator).
 
(this bundle does NOT need an activator).
 +
File->New->Plugin (project name and Equinox) -> Next
 +
Do NOT generate activator->Next
 +
Do NOT create a plug-in using one of the template->Finish
 +
 +
Then add the code from the first project. (copy the structure) and export the package.
 +
Modify main method in the Java source file as in the source code example provided below.
 +
  
 
3. Develop a bundle that uses the bundle created in the second step.
 
3. Develop a bundle that uses the bundle created in the second step.
 
The activator start method creates the Swing frame and the stop method closes it.
 
The activator start method creates the Swing frame and the stop method closes it.
 +
 +
Create a new project with for a bundel this time with an activator
 +
Import the package exported by the bundle created in the second step.
 +
In the activator invoke the method to run the Swing.
  
 
[https://cs.senecac.on.ca/~jordan.anastasiade/ECL/CourseContent/L2/Code/ECL-Lab1.zip The code for the ECL-Lab1 is here]
 
[https://cs.senecac.on.ca/~jordan.anastasiade/ECL/CourseContent/L2/Code/ECL-Lab1.zip The code for the ECL-Lab1 is here]

Revision as of 09:46, 1 October 2011

Here is the solution for your OSGi - First Lab

1. Create a Swing application (Java code) This is a Eclipse Java project. For this step, there is nothing special to be mentioned.

2. Develop a bundle that uses the Swing and export its packages (this bundle does NOT need an activator). File->New->Plugin (project name and Equinox) -> Next Do NOT generate activator->Next Do NOT create a plug-in using one of the template->Finish

Then add the code from the first project. (copy the structure) and export the package. Modify main method in the Java source file as in the source code example provided below.


3. Develop a bundle that uses the bundle created in the second step. The activator start method creates the Swing frame and the stop method closes it.

Create a new project with for a bundel this time with an activator Import the package exported by the bundle created in the second step. In the activator invoke the method to run the Swing.

The code for the ECL-Lab1 is here