Package org.summerboot.jexpress.nio.grpc
Class GRPCServerConfig
java.lang.Object
org.summerboot.jexpress.boot.config.BootConfig
org.summerboot.jexpress.nio.grpc.GRPCServerConfig
- All Implemented Interfaces:
JExpressConfig
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Nested Class Summary
Nested classes/interfaces inherited from class org.summerboot.jexpress.boot.config.BootConfig
BootConfig.ThreadingMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected List<InetSocketAddress> static final GRPCServerConfigprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected KeyManagerFactoryprotected booleanprotected TrustManagerFactoryprotected ThreadPoolExecutorprotected intprotected longprotected intprotected intprotected BootConfig.ThreadingModeFields inherited from class org.summerboot.jexpress.boot.config.BootConfig
BR, cache, cfgFile, configName, CPU_CORE, DESC_KMF, DESC_PLAINPWD, DESC_TMF, FILENAME_KEYSTORE, FILENAME_SRC_TRUSTSTORE, generateTemplate, logger, props -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidgetKmf()getTmf()getTpe()intlongintintbooleanprotected voidloadCustomizedConfigs(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) static voidprotected voidpreLoad(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) voidshutdown()Methods inherited from class org.summerboot.jexpress.boot.config.BootConfig
buildThreadPoolExecutor, buildThreadPoolExecutor, buildThreadPoolExecutor, createIfNotExist, generateTemplate, getCfgFile, getLength, getProperties, info, instance, lineBreak, load, loadField, name, parse, registerSingleton, temp, updateConfigFile, updateFilePath
-
Field Details
-
FILENAME_TRUSTSTORE_4SERVER
- See Also:
-
ID
- See Also:
-
cfg
-
bindingAddresses
@ConfigHeader(title="1. gRpc.server Network Listeners", format="ip1:port1, ip2:port2, ..., ipN:portN", example="192.168.1.10:8424, 127.0.0.1:8424, 0.0.0.0:8424") @Config(key="gRpc.server.bindings", predefinedValue="0.0.0.0:8424, 0.0.0.0:8425", required=true) protected volatile List<InetSocketAddress> bindingAddresses -
autoStart
-
tpeThreadingMode
@Config(key="gRpc.server.pool.BizExecutor.mode", defaultValue="VirtualThread", desc="valid value = VirtualThread (default for Java 21+), CPU, IO and Mixed (default for old Java) \n use CPU core + 1 when application is CPU bound\nuse CPU core x 2 + 1 when application is I/O bound\nneed to find the best value based on your performance test result when nio.server.BizExecutor.mode=Mixed") protected volatile BootConfig.ThreadingMode tpeThreadingMode -
tpeCore
@Config(key="gRpc.server.pool.coreSize", predefinedValue="0", desc="coreSize 0 = current computer/VM\'s available processors x 2 + 1") protected volatile int tpeCore -
tpeMax
@Config(key="gRpc.server.pool.maxSize", predefinedValue="0", desc="maxSize 0 = current computer/VM\'s available processors x 2 + 1") protected volatile int tpeMax -
tpeQueue
@Config(key="gRpc.server.pool.queueSize", defaultValue="2147483647", desc="The waiting list size when the pool is full") protected volatile int tpeQueue -
tpeKeepAliveSeconds
@Config(key="gRpc.server.pool.keepAliveSeconds", defaultValue="60") protected volatile long tpeKeepAliveSeconds -
prestartAllCoreThreads
@Config(key="gRpc.server.pool.prestartAllCoreThreads", defaultValue="false") protected boolean prestartAllCoreThreads -
allowCoreThreadTimeOut
@Config(key="gRpc.server.pool.allowCoreThreadTimeOut", defaultValue="false") protected boolean allowCoreThreadTimeOut -
tpe
-
KEY_kmf_key
- See Also:
-
KEY_kmf_StorePwdKey
- See Also:
-
KEY_kmf_AliasKey
- See Also:
-
KEY_kmf_AliasPwdKey
- See Also:
-
kmf
@ConfigHeader(title="2. gRpc.server keystore") @Config(key="gRpc.server.ssl.KeyStore", StorePwdKey="gRpc.server.ssl.KeyStorePwd", AliasKey="gRpc.server.ssl.KeyAlias", AliasPwdKey="gRpc.server.ssl.KeyPwd", desc="Path to key store file. Use SSL/TLS when keystore is provided, otherwise use plain socket", callbackMethodName4Dump="generateTemplate_keystore") protected volatile KeyManagerFactory kmf -
KEY_tmf_key
- See Also:
-
KEY_tmf_StorePwdKey
- See Also:
-
tmf
@ConfigHeader(title="3. gRpc.server truststore") @Config(key="gRpc.server.ssl.TrustStore", StorePwdKey="gRpc.server.ssl.TrustStorePwd", callbackMethodName4Dump="generateTemplate_truststore", desc="Path to trust store file. Auth the remote peer certificate when a truststore is provided, otherwise blindly trust all remote peer certificate") protected volatile TrustManagerFactory tmf
-
-
Constructor Details
-
GRPCServerConfig
protected GRPCServerConfig()
-
-
Method Details
-
main
-
generateTemplate_keystore
-
generateTemplate_truststore
-
preLoad
- Overrides:
preLoadin classBootConfig
-
loadCustomizedConfigs
protected void loadCustomizedConfigs(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) throws IOException - Specified by:
loadCustomizedConfigsin classBootConfig- Throws:
IOException
-
shutdown
public void shutdown() -
getBindingAddresses
-
isAutoStart
public boolean isAutoStart() -
getTpeThreadingMode
-
getTpeCore
public int getTpeCore() -
getTpeMax
public int getTpeMax() -
getTpeQueue
public int getTpeQueue() -
getTpeKeepAliveSeconds
public long getTpeKeepAliveSeconds() -
getTpe
-
getKmf
-
getTmf
-