This commit is contained in:
crusader 2018-04-25 20:47:16 +09:00
parent 2d761824a7
commit 6d54e4e823

View File

@ -38,6 +38,18 @@ public class RPCRegistry implements RPCInvoker {
return rService; return rService;
} }
public void registerService(Object receiver, Map<String, Method> methods) throws RPCException {
this.registerService(receiver, receiver.getClass().getName(), methods);
}
public void registerService(Object receiver, String name, Map<String, Method> methods) throws RPCException {
RPCService rService = this.registerService(receiver, name);
methods.forEach((methodName, method)->{
rService.registerMethod(method, methodName);
});
}
@Override @Override
public boolean hasMethod(String method) { public boolean hasMethod(String method) {
String[] sm = method.split("."); String[] sm = method.split(".");