Changes

Jump to: navigation, search

Teams Winter 2011/team2/project

782 bytes added, 15:52, 16 April 2011
no edit summary
==Steps==
 
=Prepare eclipse=
1. In Eclipse, create a new workspace.
2. Create a new Plug-in project following settings, name it consumer.<br/>
[[Image:ecl500-Team2-Project_img03.png ]]<br/><br/>
3. Likewise create 2 more plug-in projects called interface and provider. Uncheck the 'Generate Activator' option for interface.
4. In the interface bundle, we create a package, ecl.team2.project.weather. We will create classes and interface java files that are used by consumer and provider bundles.<br/>
[[Image:Ecl500-Team2-Project img04 interface.png]]<br/><br/>
5. The default MANIFEST.MF of interface bundle looks like this. It does not require any modification.
=Interface bundle=
1. In the interface bundle, we create a package, ecl.team2.project.weather. We will create classes and interface java files that are used by consumer and provider bundles.<br/>
[[Image:Ecl500-Team2-Project img04 interface.png]]<br/><br/>
2. The default MANIFEST.MF of interface bundle looks like this. It does not require any modification.
<syntaxhighlight lang="xml">
Manifest-Version: 1.0
</syntaxhighlight>
63. Create interface WeatherInterface.java
<syntaxhighlight lang="java">
package ecl.team2.project.weather;
WeatherAndCurrent getWeather(String city) throws Exception;
ArrayList<Location> getCity (String city) throws Exception;
}
</syntaxhighlight>
 
4. Create WeatherAndCurrent.java
 
<syntaxhighlight lang="java">
package ecl.team2.project.weather;
 
import java.util.ArrayList;
 
public class WeatherAndCurrent {
CurrentCondition Current;
public WeatherAndCurrent() {
super();
// TODO Auto-generated constructor stub
}
public WeatherAndCurrent(CurrentCondition current, ArrayList<Weather> weathers) {
super();
Current = current;
this.weathers = weathers;
}
public CurrentCondition getCurrent() {
return Current;
}
public void setCurrent(CurrentCondition current) {
Current = current;
}
public ArrayList<Weather> getWeathers() {
return weathers;
}
public void setWeathers(ArrayList<Weather> weathers) {
this.weathers = weathers;
}
ArrayList<Weather> weathers;
}
</syntaxhighlight>
1
edit

Navigation menu