Class Config


  • public abstract class Config
    extends java.lang.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 java.lang.String LIGHT_4J_CONFIG_DIR  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Config()  
    • Field Detail

      • LIGHT_4J_CONFIG_DIR

        public static final java.lang.String LIGHT_4J_CONFIG_DIR
        See Also:
        Constant Field Values
    • Constructor Detail

      • Config

        protected Config()
    • Method Detail

      • getJsonMapConfig

        public abstract java.util.Map<java.lang.String,​java.lang.Object> getJsonMapConfig​(java.lang.String configName)
      • getJsonMapConfigNoCache

        public abstract java.util.Map<java.lang.String,​java.lang.Object> getJsonMapConfigNoCache​(java.lang.String configName)
      • getJsonObjectConfig

        public abstract java.lang.Object getJsonObjectConfig​(java.lang.String configName,
                                                             java.lang.Class clazz)
      • getStringFromFile

        public abstract java.lang.String getStringFromFile​(java.lang.String filename)
      • getInputStreamFromFile

        public abstract java.io.InputStream getInputStreamFromFile​(java.lang.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​(java.lang.ClassLoader urlClassLoader)
      • getInstance

        public static Config getInstance()