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
    • statusReporter

      protected ScheduledExecutorService statusReporter
    • tpe

      protected ThreadPoolExecutor tpe
    • listener

      protected static NIOStatusListener listener
    • servicePaused

      protected boolean servicePaused
    • counter

      protected final Counter counter
  • Constructor Details

  • Method Details

    • initTLS

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

      public static void setListener(NIOStatusListener listener)
    • configThreadPool

      public Counter configThreadPool()
    • configThreadPool

      public Counter 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:
    • serverBuilder

      public io.grpc.ServerBuilder serverBuilder()
    • start

      public void start(boolean isBlock) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • stop

      public void stop()