Class BootConfig
java.lang.Object
org.summerboot.jexpress.boot.config.BootConfig
- All Implemented Interfaces:
JExpressConfig
- Direct Known Subclasses:
AuthConfig,BackOffice,GRPCClientConfig,GRPCServerConfig,HttpClientConfig,JPAConfig,MqttClientConfig,NioConfig,SMTPClientConfig
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Stringprotected static final Map<Class,JExpressConfig> protected Fileprotected Stringprotected static final intprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected booleanprotected org.apache.logging.log4j.Loggerprotected final Properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadPoolExecutorbuildThreadPoolExecutor(ThreadPoolExecutor tpe, String tpeName, BootConfig.ThreadingMode threadingMode, int core, int max, int queue, long keepAliveSec, RejectedExecutionHandler rejectedExecutionHandler, boolean prestartAllCoreThreads, boolean allowCoreThreadTimeOut, boolean isSingleton) protected voidcreateIfNotExist(String srcFileName, String destFileName) static StringgenerateTemplate(Class configClass) protected static intinfo()static <T extends JExpressConfig>
Tprotected static String[]voidLoad config settings with @Config, supported Java types:protected abstract voidloadCustomizedConfigs(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) protected voidloadField(Field field, String configFolder, ConfigUtil helper, Properties props, boolean autoDecrypt) name()parse(ConfigHeader memo) protected voidpreLoad(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) protected voidtemp()voidupdateConfigFile(Map<String, String> updatedCfgs) protected StringupdateFilePath(File domainDir, String fileName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.summerboot.jexpress.boot.config.JExpressConfig
shutdown
-
Field Details
-
cache
-
BR
-
DESC_KMF
- See Also:
-
DESC_TMF
- See Also:
-
DESC_PLAINPWD
- See Also:
-
FILENAME_KEYSTORE
- See Also:
-
FILENAME_SRC_TRUSTSTORE
- See Also:
-
logger
protected org.apache.logging.log4j.Logger logger -
generateTemplate
protected boolean generateTemplate -
props
-
cfgFile
-
configName
-
CPU_CORE
protected static final int CPU_CORE
-
-
Constructor Details
-
BootConfig
protected BootConfig()
-
-
Method Details
-
instance
-
getProperties
-
registerSingleton
protected void registerSingleton() -
temp
- Specified by:
tempin interfaceJExpressConfig- Returns:
- null - disable reload
-
name
- Specified by:
namein interfaceJExpressConfig
-
getCfgFile
- Specified by:
getCfgFilein interfaceJExpressConfig
-
info
- Specified by:
infoin interfaceJExpressConfig
-
createIfNotExist
-
preLoad
protected void preLoad(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) throws Exception - Throws:
Exception
-
load
Load config settings with @Config, supported Java types:1. T, K: enum, String, boolean/Boolean, byte/Byte, char/short/Short, int/Integer, long/Long, float/Float, double/Double, BigDecimal, URI, URL, Path, File 2. <T>[] array 3. Immutable Set<T> 4. Immutable List<T> 5. Immutable Map<T, K> 6. KeyManagerFactory 7. TrustManagerFactory- Specified by:
loadin interfaceJExpressConfig- Parameters:
cfgFile-isReal-- Throws:
FileNotFoundExceptionIOException
-
loadCustomizedConfigs
protected abstract void loadCustomizedConfigs(File cfgFile, boolean isReal, ConfigUtil helper, Properties props) throws Exception - Throws:
Exception
-
loadField
protected void loadField(Field field, String configFolder, ConfigUtil helper, Properties props, boolean autoDecrypt) throws IllegalAccessException - Throws:
IllegalAccessException
-
updateFilePath
-
updateConfigFile
- Throws:
IOException
-
generateTemplate
-
parse
-
lineBreak
-
getLength
-
buildThreadPoolExecutor
public static ThreadPoolExecutor buildThreadPoolExecutor(ThreadPoolExecutor tpe, String tpeName, BootConfig.ThreadingMode threadingMode, int core, int max, int queue, long keepAliveSec, RejectedExecutionHandler rejectedExecutionHandler, boolean prestartAllCoreThreads, boolean allowCoreThreadTimeOut, boolean isSingleton)
-