Please install SmartTools on your Eclipse if it is not already done.
Launch the "New SmartTools Component" wizard.
Type your component name and click Finish. It is used for the package path, so you may put mycompany.mymodule.mycomponent for example.
The wizard build the basic structure of the component: a CDML for describing the services of your component, a Facade for your business code and an Activator for OSGi.
SmartTools generates a Ant script called "buildST.xml", which will generate the container of your component, and link it to your facade.
Delete buildST.xml to force it to re-generate
Add the buildST.xml Ant script to the Ant view and execute it.
No error should be in the console
Refresh the project.
Java will compile the generates classes, and no Error should remain on the Java project.
Execute the builtST.xml everytime you change the CDML file. The wizard puts 1 input and 1 output you can duplicate as you want.
Let's create two new services, generate again the component, and complete the Facade
Duplicate the "input" and "output" entries to new entries, say for example "input2" and "output2".
Change the type of the parameters of these services
After you saved the CDML, you have to generate the component again with buildST.xml.
Remember to refresh the project.
Now Errors come from the generated Facade, which needs the input2 method from your own Facade.
Eclipse helps you in resolving this issue quickly.
Ok.
The outputs are optional, and if you want to invoke an output from your facade, you need to duplicate the method from the generated facade to your facade, and put it as an abstract method.
It should be completed now.
Now you know how to create and generate a component for PON, please follow the next tutorial where we present how to run your components in PON.
Last modified: $Date$