本文整理匯總了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);
}
}
示例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);
}
}
示例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));
}
}
示例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();
}
}
示例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;
}