Merge remote-tracking branch 'origin/master'
This commit is contained in:
		
						commit
						1c3e89e799
					
				| @ -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<ServerParam> params = request.getParamsList(); |  | ||||||
| //            ObjectMapper mapper = new ObjectMapper(); |  | ||||||
| //            mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); |  | ||||||
| // |  | ||||||
| //            Object retObj = null; |  | ||||||
| // |  | ||||||
| //            List<Class> paramTypes = new ArrayList<Class>(); |  | ||||||
| //            List<Object> valueList = new ArrayList<Object>(); |  | ||||||
| // |  | ||||||
| //            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); |  | ||||||
| //        } |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user