本文整理汇总了Java中io.grpc.MethodDescriptor.getFullMethodName方法的典型用法代码示例。如果您正苦于以下问题:Java MethodDescriptor.getFullMethodName方法的具体用法?Java MethodDescriptor.getFullMethodName怎么用?Java MethodDescriptor.getFullMethodName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.grpc.MethodDescriptor
的用法示例。
在下文中一共展示了MethodDescriptor.getFullMethodName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newStream
import io.grpc.MethodDescriptor; //导入方法依赖的package包/类
@Override
public CronetClientStream newStream(final MethodDescriptor<?, ?> method, final Metadata headers,
final CallOptions callOptions) {
Preconditions.checkNotNull(method, "method");
Preconditions.checkNotNull(headers, "headers");
final String defaultPath = "/" + method.getFullMethodName();
final String url = "https://" + authority + defaultPath;
final StatsTraceContext statsTraceCtx =
StatsTraceContext.newClientContext(callOptions, headers);
class StartCallback implements Runnable {
final CronetClientStream clientStream = new CronetClientStream(
url, userAgent, executor, headers, CronetClientTransport.this, this, lock, maxMessageSize,
alwaysUsePut, method, statsTraceCtx, callOptions, transportTracer);
@Override
public void run() {
synchronized (lock) {
if (goAway) {
clientStream.transportState().transportReportStatus(goAwayStatus, true, new Metadata());
} else if (started) {
startStream(clientStream);
} else {
throw new AssertionError("Transport is not started");
}
}
}
}
return new StartCallback().clientStream;
}
示例2: ServiceDescriptor
import io.grpc.MethodDescriptor; //导入方法依赖的package包/类
public ServiceDescriptor(MethodDescriptor descriptor) {
this.methodType = descriptor.getType();
String fullMethodName = descriptor.getFullMethodName();
this.serviceName = formatServiceName(fullMethodName) + "." + formatMethodName(fullMethodName);
}