From 6d54e4e823ccb34ed77c3d35d12fed7d641eadbe Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 25 Apr 2018 20:47:16 +0900 Subject: [PATCH] ing --- .../com/loafle/commons/rpc/registry/RPCRegistry.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/loafle/commons/rpc/registry/RPCRegistry.java b/src/main/java/com/loafle/commons/rpc/registry/RPCRegistry.java index b877c1f..4bceed0 100644 --- a/src/main/java/com/loafle/commons/rpc/registry/RPCRegistry.java +++ b/src/main/java/com/loafle/commons/rpc/registry/RPCRegistry.java @@ -38,6 +38,18 @@ public class RPCRegistry implements RPCInvoker { return rService; } + public void registerService(Object receiver, Map methods) throws RPCException { + this.registerService(receiver, receiver.getClass().getName(), methods); + } + + public void registerService(Object receiver, String name, Map methods) throws RPCException { + RPCService rService = this.registerService(receiver, name); + + methods.forEach((methodName, method)->{ + rService.registerMethod(method, methodName); + }); + } + @Override public boolean hasMethod(String method) { String[] sm = method.split(".");