Java Code Examples for com.google.protobuf.Descriptors.MethodDescriptor#getFullName()

The following examples show how to use com.google.protobuf.Descriptors.MethodDescriptor#getFullName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProtoReflectionService.java    From grpc-nebula-java with Apache License 2.0 6 votes vote down vote up
private void processService(ServiceDescriptor service, FileDescriptor fd) {
  String serviceName = service.getFullName();
  checkState(
      !fileDescriptorsBySymbol.containsKey(serviceName),
      "Service already defined: %s",
      serviceName);
  fileDescriptorsBySymbol.put(serviceName, fd);
  for (MethodDescriptor method : service.getMethods()) {
    String methodName = method.getFullName();
    checkState(
        !fileDescriptorsBySymbol.containsKey(methodName),
        "Method already defined: %s",
        methodName);
    fileDescriptorsBySymbol.put(methodName, fd);
  }
}
 
Example 2
Source File: RpcForwarder.java    From protobuf-socket-rpc with MIT License 6 votes vote down vote up
private void forwardToService(SocketRpcProtos.Request rpcRequest,
    RpcCallback<Message> callback, Service service,
    RpcController socketController) throws RpcException {
  // Get matching method
  MethodDescriptor method = getMethod(rpcRequest,
      service.getDescriptorForType());

  // Create request for method
  Message request = getRequestProto(rpcRequest,
      service.getRequestPrototype(method));

  // Call method
  try {
    service.callMethod(method, socketController, request, callback);
  } catch (RuntimeException e) {
    throw new RpcException(ErrorReason.RPC_ERROR,
        "Error running method " + method.getFullName(), e);
  }
}
 
Example 3
Source File: ProtoReflectionService.java    From grpc-java with Apache License 2.0 6 votes vote down vote up
private void processService(ServiceDescriptor service, FileDescriptor fd) {
  String serviceName = service.getFullName();
  checkState(
      !fileDescriptorsBySymbol.containsKey(serviceName),
      "Service already defined: %s",
      serviceName);
  fileDescriptorsBySymbol.put(serviceName, fd);
  for (MethodDescriptor method : service.getMethods()) {
    String methodName = method.getFullName();
    checkState(
        !fileDescriptorsBySymbol.containsKey(methodName),
        "Method already defined: %s",
        methodName);
    fileDescriptorsBySymbol.put(methodName, fd);
  }
}
 
Example 4
Source File: RemoteCallException.java    From tajo with Apache License 2.0 5 votes vote down vote up
public RemoteCallException(int seqId, MethodDescriptor methodDesc,
                           Throwable t) {
  super("Remote call error occurs when " + methodDesc.getFullName() + "is called:", t);
  this.seqId = seqId;
  if (t != null) {
    originExceptionClass = t.getClass().getCanonicalName();
  }
}
 
Example 5
Source File: SyncCoprocessorRpcChannel.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
@Private
public Message callBlockingMethod(MethodDescriptor method, RpcController controller, Message request, Message responsePrototype) throws ServiceException {
    try {
        return this.callExecService(controller, method, request, responsePrototype);
    } catch (IOException var6) {
        throw new ServiceException("Error calling method " + method.getFullName(), var6);
    }
}
 
Example 6
Source File: RemoteCallException.java    From incubator-tajo with Apache License 2.0 4 votes vote down vote up
public RemoteCallException(int seqId, MethodDescriptor methodDesc,
                           Throwable t) {
  super("Remote call error occurs when " + methodDesc.getFullName() + "is called:", t);
  this.seqId = seqId;
}