@Override protected void channelRead0(final ChannelHandlerContext ctx, final RpcRequest request) throws Exception { String methodName = request.getMethodName(); MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(methodName);
@Override protected void channelRead0(final ChannelHandlerContext ctx, final RpcRequest request) throws Exception { String methodName = request.getMethodName(); final MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(methodName); if (methodDescriptor == null) { exceptionCaught(ctx, new RemoteCallException(request.getId(), new NoSuchMethodException(methodName))); return; } try { Message paramProto = null; if (request.hasRequestMessage()) { paramProto = service.getRequestPrototype(methodDescriptor).newBuilderForType() .mergeFrom(request.getRequestMessage()).build(); } RpcController controller = new NettyRpcController(); Message returnValue = service.callBlockingMethod(methodDescriptor, controller, paramProto); RpcProtos.RpcResponse.Builder builder = RpcProtos.RpcResponse.newBuilder().setId(request.getId()); if (returnValue != null) { builder.setResponseMessage(returnValue.toByteString()); } if (controller.failed()) { builder.setErrorMessage(controller.errorText()); } ctx.writeAndFlush(builder.build()); } catch (RemoteCallException e) { exceptionCaught(ctx, e); } catch (Throwable throwable) { exceptionCaught(ctx, new RemoteCallException(request.getId(), methodDescriptor, throwable)); } }
@Override protected void channelRead0(ChannelHandlerContext ctx, RpcRequest request) throws Exception { String methodName = request.getMethodName(); MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(methodName);
@Override protected void channelRead0(final ChannelHandlerContext ctx, final RpcRequest request) throws Exception { String methodName = request.getMethodName(); final MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(methodName);
@Override protected void channelRead0(final ChannelHandlerContext ctx, final RpcRequest request) throws Exception { String methodName = request.getMethodName(); final MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(methodName);
@Override protected void channelRead0(final ChannelHandlerContext ctx, final RpcRequest request) throws Exception { String methodName = request.getMethodName(); final MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(methodName); if (methodDescriptor == null) { exceptionCaught(ctx, new RemoteCallException(request.getId(), new NoSuchMethodException(methodName))); return; } try { Message paramProto = null; if (request.hasRequestMessage()) { paramProto = service.getRequestPrototype(methodDescriptor).newBuilderForType() .mergeFrom(request.getRequestMessage()).build(); } RpcController controller = new NettyRpcController(); Message returnValue = service.callBlockingMethod(methodDescriptor, controller, paramProto); RpcProtos.RpcResponse.Builder builder = RpcProtos.RpcResponse.newBuilder().setId(request.getId()); if (returnValue != null) { builder.setResponseMessage(returnValue.toByteString()); } if (controller.failed()) { builder.setErrorMessage(controller.errorText()); } ctx.writeAndFlush(builder.build()); } catch (RemoteCallException e) { exceptionCaught(ctx, e); } catch (Throwable throwable) { exceptionCaught(ctx, new RemoteCallException(request.getId(), methodDescriptor, throwable)); } }
/** * <code>required string method_name = 2;</code> */ public Builder clearMethodName() { bitField0_ = (bitField0_ & ~0x00000002); methodName_ = getDefaultInstance().getMethodName(); onChanged(); return this; } /**
/** * <code>required string method_name = 2;</code> */ public Builder clearMethodName() { bitField0_ = (bitField0_ & ~0x00000002); methodName_ = getDefaultInstance().getMethodName(); onChanged(); return this; } /**
/** * <code>required string method_name = 2;</code> */ public Builder clearMethodName() { bitField0_ = (bitField0_ & ~0x00000002); methodName_ = getDefaultInstance().getMethodName(); onChanged(); return this; } /**