您的位置:首页 > Web前端 > JavaScript

jsonrpc4j 解析

2018-07-11 21:30 141 查看
来源 https://github.com/briandilley/jsonrpc4j

综合服务

可以使用其中一种ProxyUtil::createCompositeService(...)方法将多个服务组合到一个服务器中

UserverService userService = ...;
ContentService contentService = ...;
BlackJackService blackJackService = ...;

Object compositeService = ProxyUtil.createCompositeServiceProxy(
this.getClass().getClassLoader(),
new Object[] { userService, contentService, blackJackService},
new Class<?>[] { UserService.class, ContentService.class, BlackJackService.class},
true);

// now compositeService can be used as any of the above service, ie:
User user = ((UserverService)compositService).createUser(...);
Content content =  ((ContentService)compositService).getContent(...);
Hand hand = ((BlackJackService)compositService).dealHand(...);

StreamServer

自定义方法名称

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: