Class Bootstrap

java.lang.Object
gov.usgs.earthquake.distribution.Bootstrap

public class Bootstrap extends 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 Details

    • CONFIGFILE_ARGUMENT

      public static final String CONFIGFILE_ARGUMENT
      Argument for config file.
      See Also:
    • DEFAULT_CONFIGFILE

      public static final String DEFAULT_CONFIGFILE
      Default config file.
      See Also:
    • CONFIG_TEST_ARGUMENT

      public static final String CONFIG_TEST_ARGUMENT
      Whether to test config only.
      See Also:
    • LOGFORMAT_PROPERTY_NAME

      public static final String LOGFORMAT_PROPERTY_NAME
      Property for log format.
      See Also:
    • LOGFORMAT_PDL

      public static final String LOGFORMAT_PDL
      log format value for "pdl" format
      See Also:
    • LOGFORMAT_SIMPLE

      public static final String LOGFORMAT_SIMPLE
      log format value for java "simple" format
      See Also:
    • LOGFORMAT_XML

      public static final String LOGFORMAT_XML
      log format value for java "xml" format
      See Also:
    • DEFAULT_LOGFORMAT

      public static final String DEFAULT_LOGFORMAT
      Default log format is "simple".
      See Also:
    • LOGLEVEL_PROPERTY_NAME

      public static final String LOGLEVEL_PROPERTY_NAME
      Property for log level.
      See Also:
    • DEFAULT_LOGLEVEL

      public static final String DEFAULT_LOGLEVEL
      Default log level is "INFO".
      See Also:
    • LOG_TIMESTAMPS_PROPERTY_NAME

      public static final String LOG_TIMESTAMPS_PROPERTY_NAME
      Property for log timestamps.
      See Also:
    • DEFAULT_TIMESTAMPS

      public static final String DEFAULT_TIMESTAMPS
      Default timestamps is "false".
      See Also:
    • LOGDIRECTORY_PROPERTY_NAME

      public static final String LOGDIRECTORY_PROPERTY_NAME
      Property for log directory.
      See Also:
    • DEFAULT_LOGDIRECTORY

      public static final String DEFAULT_LOGDIRECTORY
      Default log directory is "log".
      See Also:
    • LOGFILE_PROPERTY_NAME

      public static final String LOGFILE_PROPERTY_NAME
      Property for log file pattern.
      See Also:
    • DEFAULT_LOGFILE

      public static final String DEFAULT_LOGFILE
      Default log file pattern is "yyyyMMdd'.log'".
      See Also:
    • CONSOLEREDIRECT_PROPERTY_NAME

      public static final String CONSOLEREDIRECT_PROPERTY_NAME
      Property for console redirect.
      See Also:
    • DEFAULT_CONSOLEREDIRECT

      public static final String DEFAULT_CONSOLEREDIRECT
      Default console redirect value is "false" (don't redirect).
      See Also:
    • MAINCLASS_ARGUMENT

      public static final String MAINCLASS_ARGUMENT
      Argument for mainclass.
      See Also:
    • MAINCLASS_PROPERTY_NAME

      public static final String MAINCLASS_PROPERTY_NAME
      Property for mainclass.
      See Also:
    • DEFAULT_MAINCLASS

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

      public static final String VERSION_ARGUMENT
      Argument for version
      See Also:
  • Constructor Details

    • Bootstrap

      public Bootstrap()
      Constructor
  • Method Details

    • loadConfig

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

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

      public static void main(String[] args) throws Exception
      command to start application
      Parameters:
      args - command line arguments
      Throws:
      Exception - on error