use of com.weibo.motan.demo.service.PbParamService in project motan by weibocom.
the class Motan2RpcClient method main.
public static void main(String[] args) throws Throwable {
ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] { "classpath:motan2_demo_client.xml" });
MotanDemoService service;
// hessian
service = (MotanDemoService) ctx.getBean("motanDemoReferer");
print(service);
// simple serialization
service = (MotanDemoService) ctx.getBean("motanDemoReferer-simple");
print(service);
// breeze serialization
service = (MotanDemoService) ctx.getBean("motanDemoReferer-breeze");
print(service);
// pb serialization
PbParamService pbService = (PbParamService) ctx.getBean("motanDemoReferer-pb");
System.out.println(pbService.getFeature(Point.newBuilder().setLatitude(123).setLongitude(456).build()));
// common client
CommonHandler xmlClient = (CommonHandler) ctx.getBean("motanDemoReferer-common-client");
motan2XmlCommonClientDemo(xmlClient);
motan2ApiCommonClientDemo();
System.out.println("motan demo is finish.");
System.exit(0);
}
Aggregations