diff --git a/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java b/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java index a805e84..0688954 100644 --- a/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java +++ b/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java @@ -91,83 +91,8 @@ public class ServiceProxy { } -// String targetServiceName = request.getTarget(); -// Object service = ctx.getBean(targetServiceName); -// -// if(service != null) { -// try { -// -// String jsonResult = process(request, service); -// -// ServerOutput reply = ServerOutput.newBuilder() -// .setResult(jsonResult) -// .build(); -// responseObserver.onNext(reply); -// responseObserver.onCompleted(); -// }catch(Exception e) { -// e.printStackTrace(); -// responseObserver.onError(e); -// } -// -// }else { -// responseObserver.onError(new Exception("Not assigned Service :" + service)); -// } } -// private String process(ServerInput request, Object service) throws Exception { -// -// String methodName = request.getMethod(); -// List params = request.getParamsList(); -// ObjectMapper mapper = new ObjectMapper(); -// mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); -// -// Object retObj = null; -// -// List paramTypes = new ArrayList(); -// List valueList = new ArrayList(); -// -// for( ServerParam param : params ){ -// -// if(false == param.getIsCollection()) { -// Class cls = Class.forName(param.getType()); -// Object obj = mapper.readValue(param.getData(), cls); -// paramTypes.add(cls); -// valueList.add(obj); -// }else { -// String type = param.getType(); -// int idx = type.indexOf("|"); -// String firstClassName = type.substring(0, idx); -// String lastClassName = type.substring(idx+1); -// Class firstCls = Class.forName(firstClassName); -// Class lastCls = Class.forName(lastClassName); -// mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); -// Object obj = mapper.readValue(param.getData(), mapper.getTypeFactory().constructCollectionType(firstCls, lastCls)); -// -// paramTypes.add(firstCls); -// valueList.add(obj); -// } -// -// -// } -// Method method = null; -// if(params.size() > 0) { -// method = MethodSeeker.getMethod(service.getClass(),methodName, paramTypes); -// if (method == null) { -// throw new Exception("Not found method : " + methodName); -// } -// retObj = method.invoke(service, valueList.toArray(new Object[valueList.size()])); -// } -// else { -// method = service.getClass().getMethod(methodName); -// retObj = method.invoke(service); -// } -// -// if(retObj == null) { -// return ""; -// } -// -// return mapper.writeValueAsString(retObj); -// } } }