类io.grpc.Internal源码实例Demo

下面列出了怎么用io.grpc.Internal的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: grpc-nebula-java   文件: NettyChannelBuilder.java
@Override
@CheckReturnValue
@Internal
protected ClientTransportFactory buildTransportFactory() {
  ProtocolNegotiator negotiator;
  if (protocolNegotiatorFactory != null) {
    negotiator = protocolNegotiatorFactory.buildProtocolNegotiator();
  } else {
    SslContext localSslContext = sslContext;
    if (negotiationType == NegotiationType.TLS && localSslContext == null) {
      try {
        localSslContext = GrpcSslContexts.forClient().build();
      } catch (SSLException ex) {
        throw new RuntimeException(ex);
      }
    }
    negotiator = createProtocolNegotiatorByType(negotiationType, localSslContext);
  }
  return new NettyTransportFactory(
      negotiator, channelType, channelOptions,
      eventLoopGroup, flowControlWindow, maxInboundMessageSize(),
      maxHeaderListSize, keepAliveTimeNanos, keepAliveTimeoutNanos, keepAliveWithoutCalls,
      transportTracerFactory.create(), localSocketPicker);
}
 
源代码2 项目: grpc-java   文件: OkHttpChannelBuilder.java
@Override
@Internal
protected final ClientTransportFactory buildTransportFactory() {
  boolean enableKeepAlive = keepAliveTimeNanos != KEEPALIVE_TIME_NANOS_DISABLED;
  return new OkHttpTransportFactory(
      transportExecutor,
      scheduledExecutorService,
      socketFactory,
      createSslSocketFactory(),
      hostnameVerifier,
      connectionSpec,
      maxInboundMessageSize(),
      enableKeepAlive,
      keepAliveTimeNanos,
      keepAliveTimeoutNanos,
      flowControlWindow,
      keepAliveWithoutCalls,
      maxInboundMetadataSize,
      transportTracerFactory,
      useGetForSafeMethods);
}
 
源代码3 项目: grpc-java   文件: InternalInProcess.java
/**
 * Creates a new InProcessTransport.
 *
 * <p>When started, the transport will be registered with the given
 * {@link ServerListener}.
 */
@Internal
public static ConnectionClientTransport createInProcessTransport(
    String name,
    int maxInboundMetadataSize,
    String authority,
    String userAgent,
    Attributes eagAttrs,
    ObjectPool<ScheduledExecutorService> serverSchedulerPool,
    List<ServerStreamTracer.Factory> serverStreamTracerFactories,
    ServerListener serverListener) {
  return new InProcessTransport(
      name,
      maxInboundMetadataSize,
      authority,
      userAgent,
      eagAttrs,
      serverSchedulerPool,
      serverStreamTracerFactories,
      serverListener);
}
 
源代码4 项目: grpc-nebula-java   文件: OkHttpChannelBuilder.java
@Override
@Internal
protected final ClientTransportFactory buildTransportFactory() {
  boolean enableKeepAlive = keepAliveTimeNanos != KEEPALIVE_TIME_NANOS_DISABLED;
  return new OkHttpTransportFactory(transportExecutor, scheduledExecutorService,
      createSocketFactory(), hostnameVerifier, connectionSpec, maxInboundMessageSize(),
      enableKeepAlive, keepAliveTimeNanos, keepAliveTimeoutNanos, flowControlWindow,
      keepAliveWithoutCalls, maxInboundMetadataSize, transportTracerFactory);
}
 
源代码5 项目: grpc-nebula-java   文件: NettyChannelBuilder.java
@Override
@CheckReturnValue
@Internal
protected String checkAuthority(String authority) {
  if (authorityChecker != null) {
    return authorityChecker.checkAuthority(authority);
  }
  return super.checkAuthority(authority);
}
 
源代码6 项目: grpc-java   文件: NettyChannelBuilder.java
@Override
@CheckReturnValue
@Internal
protected ClientTransportFactory buildTransportFactory() {
  assertEventLoopAndChannelType();

  ProtocolNegotiator negotiator;
  if (protocolNegotiatorFactory != null) {
    negotiator = protocolNegotiatorFactory.buildProtocolNegotiator();
  } else {
    SslContext localSslContext = sslContext;
    if (negotiationType == NegotiationType.TLS && localSslContext == null) {
      try {
        localSslContext = GrpcSslContexts.forClient().build();
      } catch (SSLException ex) {
        throw new RuntimeException(ex);
      }
    }
    negotiator = createProtocolNegotiatorByType(negotiationType, localSslContext,
        this.getOffloadExecutorPool());
  }

  return new NettyTransportFactory(
      negotiator, channelFactory, channelOptions,
      eventLoopGroupPool, autoFlowControl, flowControlWindow, maxInboundMessageSize(),
      maxHeaderListSize, keepAliveTimeNanos, keepAliveTimeoutNanos, keepAliveWithoutCalls,
      transportTracerFactory, localSocketPicker, useGetForSafeMethods);
}
 
源代码7 项目: grpc-java   文件: NettyChannelBuilder.java
@Override
@CheckReturnValue
@Internal
protected String checkAuthority(String authority) {
  if (authorityChecker != null) {
    return authorityChecker.checkAuthority(authority);
  }
  return super.checkAuthority(authority);
}
 
@Override
@Internal
protected ClientTransportFactory buildTransportFactory() {
  return new InProcessClientTransportFactory(
      name, scheduledExecutorService, maxInboundMetadataSize);
}
 
源代码9 项目: grpc-java   文件: InProcessChannelBuilder.java
@Override
@Internal
protected ClientTransportFactory buildTransportFactory() {
  return new InProcessClientTransportFactory(
      name, scheduledExecutorService, maxInboundMetadataSize, transportIncludeStatusCause);
}
 
/**
 * Children of AbstractServerBuilder should override this method to provide transport specific
 * information for the server.  This method is mean for Transport implementors and should not be
 * used by normal users.
 *
 * @param streamTracerFactories an immutable list of stream tracer factories
 */
@Internal
protected abstract io.grpc.internal.InternalServer buildTransportServer(
    List<ServerStreamTracer.Factory> streamTracerFactories);
 
 类所在包
 类方法
 同包方法