Package org.summerboot.jexpress.nio.grpc
Class GRPCServer
java.lang.Object
org.summerboot.jexpress.nio.grpc.GRPCServer
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Counterprotected static NIOStatusListenerprotected static final org.apache.logging.log4j.Loggerprotected final intprotected io.grpc.Serverprotected final io.grpc.ServerBuilderprotected final io.grpc.ServerCredentialsprotected booleanprotected ScheduledExecutorServiceprotected ThreadPoolExecutor -
Constructor Summary
ConstructorsConstructorDescriptionGRPCServer(String bindingAddr, int port, io.grpc.ServerCredentials serverCredentials) GRPCServer(String bindingAddr, int port, KeyManagerFactory kmf, TrustManagerFactory tmf) -
Method Summary
Modifier and TypeMethodDescriptionconfigThreadPool(int poolCoreSize, int poolMaxSizeMaxSize, int poolQueueSize, long keepAliveSeconds) static io.grpc.ServerCredentialsinitTLS(KeyManagerFactory kmf, TrustManagerFactory tmf) io.grpc.ServerBuilderstatic voidsetListener(NIOStatusListener listener) voidshutdown()voidstart()voidstart(boolean isBlock)
-
Field Details
-
log
protected static final org.apache.logging.log4j.Logger log -
server
protected io.grpc.Server server -
bindingAddr
-
port
protected final int port -
serverCredentials
protected final io.grpc.ServerCredentials serverCredentials -
serverBuilder
protected final io.grpc.ServerBuilder serverBuilder -
statusReporter
-
tpe
-
listener
-
servicePaused
protected boolean servicePaused -
counter
-
-
Constructor Details
-
GRPCServer
-
GRPCServer
-
-
Method Details
-
initTLS
-
setListener
-
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 setpoolMaxSizeMaxSize- - the maximum number of threads to allow in the poolpoolQueueSize- - the size of the waiting listkeepAliveSeconds- - 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
- Throws:
IOException
-
start
- Throws:
IOException
-
shutdown
public void shutdown()
-