Class ConfigLoader

    • Field Detail

      • state

        private volatile ConfigLoader.State state
        Mark volatile so that the installation of new versions is guaranteed to be visible across threads.
      • configFile

        private File configFile
      • configFileName

        private String configFileName
      • config

        private Config config
    • Constructor Detail

      • ConfigLoader

        public ConfigLoader​(File configFile)
                     throws javax.servlet.ServletException
        Create new ConfigLoader using supplied File.
        Throws:
        javax.servlet.ServletException
      • ConfigLoader

        public ConfigLoader​(String configFileName,
                            Config config)
                     throws javax.servlet.ServletException
        Create new ConfigLoader using supplied filename and config.
        Throws:
        javax.servlet.ServletException
    • Method Detail

      • getDecoratorByName

        public Decorator getDecoratorByName​(String name)
                                     throws javax.servlet.ServletException
        Retrieve Decorator based on name specified in configuration file.
        Throws:
        javax.servlet.ServletException
      • getMappedName

        public String getMappedName​(String path)
                             throws javax.servlet.ServletException
        Get name of Decorator mapped to given path.
        Throws:
        javax.servlet.ServletException
      • loadConfig

        private ConfigLoader.State loadConfig()
                                       throws javax.servlet.ServletException
        Load configuration from file.
        Throws:
        javax.servlet.ServletException
      • getContainedText

        private static String getContainedText​(Node parent,
                                               String childTagName)
      • refresh

        private ConfigLoader.State refresh()
                                    throws javax.servlet.ServletException
        Check if configuration file has been updated, and if so, reload.
        Throws:
        javax.servlet.ServletException