當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodDescriptor.getFullName方法代碼示例

本文整理匯總了Java中com.google.protobuf.Descriptors.MethodDescriptor.getFullName方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodDescriptor.getFullName方法的具體用法?Java MethodDescriptor.getFullName怎麽用?Java MethodDescriptor.getFullName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.protobuf.Descriptors.MethodDescriptor的用法示例。


在下文中一共展示了MethodDescriptor.getFullName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: forwardToService

import com.google.protobuf.Descriptors.MethodDescriptor; //導入方法依賴的package包/類
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);
  }
}
 
開發者ID:sdeo,項目名稱:protobuf-socket-rpc,代碼行數:20,代碼來源:RpcForwarder.java

示例2: processService

import com.google.protobuf.Descriptors.MethodDescriptor; //導入方法依賴的package包/類
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);
  }
}
 
開發者ID:grpc,項目名稱:grpc-java,代碼行數:17,代碼來源:ProtoReflectionService.java

示例3: register

import com.google.protobuf.Descriptors.MethodDescriptor; //導入方法依賴的package包/類
public void register(Service service) {
    // TODO: Support registering multiple local services? Needs "local 2PC" effectively. Yuck.
    Descriptors.ServiceDescriptor descriptor = service.getDescriptorForType();
    for (MethodDescriptor i : descriptor.getMethods()) {
        if (methods.containsKey(i.getFullName())) {
            throw new IllegalStateException(
                    "method " + i.getFullName() + " is already registered");
        }
        methods.put(i.getFullName(), new ProtoMethodInvoker(service, i));
    }
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:12,代碼來源:ServiceRegistry.java

示例4: RemoteCallException

import com.google.protobuf.Descriptors.MethodDescriptor; //導入方法依賴的package包/類
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();
  }
}
 
開發者ID:apache,項目名稱:tajo,代碼行數:9,代碼來源:RemoteCallException.java

示例5: RemoteCallException

import com.google.protobuf.Descriptors.MethodDescriptor; //導入方法依賴的package包/類
public RemoteCallException(int seqId, MethodDescriptor methodDesc,
                           Throwable t) {
  super("Remote call error occurs when " + methodDesc.getFullName() + "is called:", t);
  this.seqId = seqId;
}
 
開發者ID:apache,項目名稱:incubator-tajo,代碼行數:6,代碼來源:RemoteCallException.java


注:本文中的com.google.protobuf.Descriptors.MethodDescriptor.getFullName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。