RPC实现Provider服务端业务逻辑
生活随笔
收集整理的這篇文章主要介紹了
RPC实现Provider服务端业务逻辑
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我們將API 中定義的所有功能在provider 模塊中實現,分別創建兩個實現類:
RpcHelloServiceImpl 類:
public class RpcHelloServiceImpl implements IRpcHelloService {public String hello(String name) {return "Hello " + name + "!";} }RpcServiceImpl 類:
public class RpcServiceImpl implements IRpcService {public int add(int a, int b) {return a + b;}public int sub(int a, int b) {return a - b;}public int mult(int a, int b) {return a * b;}public int div(int a, int b) {return a / b;} }?
總結
以上是生活随笔為你收集整理的RPC实现Provider服务端业务逻辑的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RPC创建API 模块
- 下一篇: RPC实现Consumer 远程调用