Class Bootstrap


  • public class Bootstrap
    extends java.lang.Object
    Bootstrap is a class used to start an application. It loads a configuration file, sets up initial logging, and starts a configurable main method.
    • Field Detail

      • JAR_CONFIGFILE

        public static final java.lang.String JAR_CONFIGFILE
        Default JAR config path.
        See Also:
        Constant Field Values
      • CONFIGFILE_ARGUMENT

        public static final java.lang.String CONFIGFILE_ARGUMENT
        Argument for config file.
        See Also:
        Constant Field Values
      • DEFAULT_CONFIGFILE

        public static final java.lang.String DEFAULT_CONFIGFILE
        Default config file.
        See Also:
        Constant Field Values
      • CONFIG_TEST_ARGUMENT

        public static final java.lang.String CONFIG_TEST_ARGUMENT
        Whether to test config only.
        See Also:
        Constant Field Values
      • LOGFORMAT_PROPERTY_NAME

        public static final java.lang.String LOGFORMAT_PROPERTY_NAME
        Property for log format.
        See Also:
        Constant Field Values
      • LOGFORMAT_PDL

        public static final java.lang.String LOGFORMAT_PDL
        log format value for "pdl" format
        See Also:
        Constant Field Values
      • LOGFORMAT_SIMPLE

        public static final java.lang.String LOGFORMAT_SIMPLE
        log format value for java "simple" format
        See Also:
        Constant Field Values
      • LOGFORMAT_XML

        public static final java.lang.String LOGFORMAT_XML
        log format value for java "xml" format
        See Also:
        Constant Field Values
      • DEFAULT_LOGFORMAT

        public static final java.lang.String DEFAULT_LOGFORMAT
        Default log format is "simple".
        See Also:
        Constant Field Values
      • LOGLEVEL_PROPERTY_NAME

        public static final java.lang.String LOGLEVEL_PROPERTY_NAME
        Property for log level.
        See Also:
        Constant Field Values
      • DEFAULT_LOGLEVEL

        public static final java.lang.String DEFAULT_LOGLEVEL
        Default log level is "INFO".
        See Also:
        Constant Field Values
      • LOGDIRECTORY_PROPERTY_NAME

        public static final java.lang.String LOGDIRECTORY_PROPERTY_NAME
        Property for log directory.
        See Also:
        Constant Field Values
      • DEFAULT_LOGDIRECTORY

        public static final java.lang.String DEFAULT_LOGDIRECTORY
        Default log directory is "log".
        See Also:
        Constant Field Values
      • LOGFILE_PROPERTY_NAME

        public static final java.lang.String LOGFILE_PROPERTY_NAME
        Property for log file pattern.
        See Also:
        Constant Field Values
      • DEFAULT_LOGFILE

        public static final java.lang.String DEFAULT_LOGFILE
        Default log file pattern is "yyyyMMdd'.log'".
        See Also:
        Constant Field Values
      • CONSOLEREDIRECT_PROPERTY_NAME

        public static final java.lang.String CONSOLEREDIRECT_PROPERTY_NAME
        Property for console redirect.
        See Also:
        Constant Field Values
      • DEFAULT_CONSOLEREDIRECT

        public static final java.lang.String DEFAULT_CONSOLEREDIRECT
        Default console redirect value is "false" (don't redirect).
        See Also:
        Constant Field Values
      • ENABLE_TRACKER_PROPERTY_NAME

        public static final java.lang.String ENABLE_TRACKER_PROPERTY_NAME
        Property used to disable tracker updates.
        See Also:
        Constant Field Values
      • MAINCLASS_ARGUMENT

        public static final java.lang.String MAINCLASS_ARGUMENT
        Argument for mainclass.
        See Also:
        Constant Field Values
      • MAINCLASS_PROPERTY_NAME

        public static final java.lang.String MAINCLASS_PROPERTY_NAME
        Property for mainclass.
        See Also:
        Constant Field Values
      • DEFAULT_MAINCLASS

        public static final java.lang.String DEFAULT_MAINCLASS
        Default mainclass is "gov.usgs.earthquake.distribution.ProductClient.
        See Also:
        Constant Field Values
      • VERSION_ARGUMENT

        public static final java.lang.String VERSION_ARGUMENT
        Argument for version
        See Also:
        Constant Field Values
    • Constructor Detail

      • Bootstrap

        public Bootstrap()
        Constructor
    • Method Detail

      • loadConfig

        public Config loadConfig​(java.io.File configFile)
                          throws java.io.IOException
        Read configuration from inside jar file, and configFile.
        Parameters:
        configFile - config file to load.
        Returns:
        config
        Throws:
        java.io.IOException - if IO error occurs
      • setupLogging

        public void setupLogging​(Config config)
        Sets up LogManager
        Parameters:
        config - Config file
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception