a little、 light and simple thrift client library, for java,android,etc..
people use thrift protocol, a RCP selection.
- want a litte interface jar,such as android use.
- the server has many iterface methods,but you or your customer just need little some of these.
you can write a Iterface and a JavaBean like this:
public interface MyService{// the name of this Iterface is random as you like
// you could only have a single method,but the server has manay methods.
// in this way,you can hide interface to your Customer
String sayHi(Person p) throws HelloException;
// the ParameterName of every parameter is same as it in the .thrift file
}
public class Person{
public @Index(1) String name;
public @Index(2) int age;
... optional Getters and Setter
}
Invoke example:
TProtocol iprot =....
MyService clientIface = ClientInterfaceFactory.getClientInterface(MyService.class,iprot);
Person liming = new Person();
liming.name="LiMing";
String response = clientIface.sayHi(liming);
System.out.println(response);