Class GRPCServer

java.lang.Object
org.summerboot.jexpress.nio.grpc.GRPCServer

public class GRPCServer extends Object
Author:
Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
  • Field Details

    • log

      protected static final org.apache.logging.log4j.Logger log
    • server

      protected io.grpc.Server server
    • bindingAddr

      protected final String bindingAddr
    • port

      protected final int port
    • serverCredentials

      protected final io.grpc.ServerCredentials serverCredentials
    • serverBuilder

      protected final io.grpc.ServerBuilder serverBuilder
    • serverInterceptor

      protected io.grpc.ServerInterceptor serverInterceptor
    • statusReporter

      protected ScheduledExecutorService statusReporter
    • tpe

      protected ThreadPoolExecutor tpe
    • listener

      protected static NIOStatusListener listener
    • servicePaused

      protected boolean servicePaused
    • serviceCounter

      protected final GRPCServiceCounter serviceCounter
    • context

      protected SummerRunner.RunnerContext context
  • Constructor Details

  • Method Details

    • initTLS

      public static io.grpc.ServerCredentials initTLS(KeyManagerFactory kmf, TrustManagerFactory tmf)
    • getServerInterceptor

      public io.grpc.ServerInterceptor getServerInterceptor()
    • setContext

      public void setContext(SummerRunner.RunnerContext context)
    • getServerBuilder

      public io.grpc.ServerBuilder getServerBuilder()
    • getServiceCounter

      public GRPCServiceCounter getServiceCounter()
    • setListener

      public static void setListener(NIOStatusListener listener)
    • configThreadPool

      public GRPCServiceCounter configThreadPool()
    • configThreadPool

      public GRPCServiceCounter configThreadPool(int poolCoreSize, int poolMaxSizeMaxSize, int poolQueueSize, long keepAliveSeconds)
      Parameters:
      poolCoreSize - - the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOutis set
      poolMaxSizeMaxSize - - the maximum number of threads to allow in the pool
      poolQueueSize - - the size of the waiting list
      keepAliveSeconds - - when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
      Returns:
    • start

      public void start() throws IOException
      Throws:
      IOException
    • start

      public void start(boolean isBlock) throws IOException
      openssl s_client -connect server:port -alpn h2
      Parameters:
      isBlock -
      Throws:
      IOException
    • shutdown

      public void shutdown()