????Hessian??Burlap???????HTTP?????????????RMI??????????????????????????????RPC????а??????л????????RMI???Hessian??Burlap???
???????Hessian??Burlap???????????е????л????????RMI??????Java????????л??????????????????????????Hessian/Burlap?????л????????????????
????Spring????????????RMI????????HTTP????????????Spring??HttpInvoker????????
????Spring??HttpInvoker????????HTTP?????RPC???????????Java????????л??????
???????????????
?????????????????????????????????Serializable???
package entity;
import java.io.Serializable;
public class Fruit implements Serializable {
private String name;
private String color;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
??????????????????
????package service;
????import java.util.List;
????import entity.Fruit;
????public interface FruitService {
????List<Fruit> getFruitList();
????}
???????????????????????????е???
package service.impl;
import java.util.ArrayList;
import java.util.List;
import service.FruitService;
import entity.Fruit;
public class FruitServiceImpl implements FruitService {
public List<Fruit> getFruitList() {
List<Fruit> list = new ArrayList<Fruit>();
Fruit f1 = new Fruit();
f1.setName("????");
f1.setColor("???");
Fruit f2 = new Fruit();
f2.setName("???");
f2.setColor("???");
list.add(f1);
list.add(f2);
return list;
}
}????Hessian??Burlap???????HTTP?????????????RMI??????????????????????????????RPC????а??????л????????RMI???Hessian??Burlap???
???????Hessian??Burlap???????????е????л????????RMI??????Java????????л??????????????????????????Hessian/Burlap?????л????????????????
????Spring????????????RMI????????HTTP????????????Spring??HttpInvoker????????
????Spring??HttpInvoker????????HTTP?????RPC???????????Java????????л??????
???????????????
???????????????????????????????Serializable???
package entity;
import java.io.Serializable;
public class Fruit implements Serializable {
private String name;
private String color;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
??????????????????
????package service;
????import java.util.List;
????import entity.Fruit;
????public interface FruitService {
????List<Fruit> getFruitList();
????}
???????????????????????????е???
package service.impl;
import java.util.ArrayList;
import java.util.List;
import service.FruitService;
import entity.Fruit;
public class FruitServiceImpl implements FruitService {
public List<Fruit> getFruitList() {
List<Fruit> list = new ArrayList<Fruit>();
Fruit f1 = new Fruit();
f1.setName("????");
f1.setColor("???");
Fruit f2 = new Fruit();
f2.setName("???");
f2.setColor("???");
list.add(f1);
list.add(f2);
return list;
}
}