With SCA, one can easily make errors by mispelling an element name (e.g. a service name)
or by making incompatible interfaces (e.g. in a wire).
A convenient solution to avoid these
errors when starting from zero, is to create a complete composite and then to generate the Java
code skeleton of your SCA application. SCA Tools now provides such a feature.
To generate Java code from an assembly file:
Here is a sample file, generated with this method.
/*
* Generated from WeatherApplication.composite on 05/26/09 at 16:28:12.
*/
package weather.impl;
import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
import org.toto2.Toto2;
import simpleweather.interfaces.SimpleWeatherService_PortType;
import weather.interfaces.GlobalWeatherService;
@Service( interfaces={Toto2.class, GlobalWeatherService.class})
public class GlobalWeatherImpl implements Toto2, GlobalWeatherService {
//
// Properties
@Property
public Object pouf24; // TODO: replace "Object" by the right type.
@Property
public Object pouf23; // TODO: replace "Object" by the right type.
//
// References
private SimpleWeatherService_PortType simpleWeatherReference;
@Reference
public void setSimpleWeatherReference( SimpleWeatherService_PortType simpleWeatherReference ) {
this.simpleWeatherReference = simpleWeatherReference;
}
// TODO: define the service implementation.
}