Package com.networknt.config
Class Config
- java.lang.Object
-
- com.networknt.config.Config
-
public abstract class Config extends Object
A injectable singleton config that has default implementation based on FileSystem json files. It can be extended to other sources (database, distributed cache etc.) by providing another jar in the classpath to replace the default implementation.Config files are loaded in the following sequence: 1. resource/config folder for the default 2. externalized directory specified by light-4j-config-dir
In docker, the config files should be in volume and any update will be picked up the next day morning.
-
-
Field Summary
Fields Modifier and Type Field Description static StringLIGHT_4J_CONFIG_DIR
-
Constructor Summary
Constructors Modifier Constructor Description protectedConfig()
-
Method Summary
-
-
-
Field Detail
-
LIGHT_4J_CONFIG_DIR
public static final String LIGHT_4J_CONFIG_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultJsonMapConfig
public abstract Map<String,Object> getDefaultJsonMapConfig(String configName)
-
getJsonMapConfig
public abstract Map<String,Object> getJsonMapConfig(String configName, String path)
-
getDefaultJsonMapConfig
public abstract Map<String,Object> getDefaultJsonMapConfig(String configName, String path)
-
getJsonMapConfigNoCache
public abstract Map<String,Object> getJsonMapConfigNoCache(String configName)
-
getDefaultJsonMapConfigNoCache
public abstract Map<String,Object> getDefaultJsonMapConfigNoCache(String configName)
-
getJsonMapConfigNoCache
public abstract Map<String,Object> getJsonMapConfigNoCache(String configName, String path)
-
getDefaultJsonMapConfigNoCache
public abstract Map<String,Object> getDefaultJsonMapConfigNoCache(String configName, String path)
-
getDefaultJsonObjectConfig
public abstract Object getDefaultJsonObjectConfig(String configName, Class clazz)
-
getJsonObjectConfig
public abstract Object getJsonObjectConfig(String configName, Class clazz, String path)
-
getDefaultJsonObjectConfig
public abstract Object getDefaultJsonObjectConfig(String configName, Class clazz, String path)
-
getInputStreamFromFile
public abstract InputStream getInputStreamFromFile(String filename)
-
getMapper
public abstract com.fasterxml.jackson.databind.ObjectMapper getMapper()
-
getYaml
public abstract org.yaml.snakeyaml.Yaml getYaml()
-
clear
public abstract void clear()
-
setClassLoader
public abstract void setClassLoader(ClassLoader urlClassLoader)
-
getInstance
public static Config getInstance()
-
-