edu.sc.seis.sod
Class Start

java.lang.Object
  extended by edu.sc.seis.sod.Start

public class Start
extends java.lang.Object


Nested Class Summary
static class Start.InputSourceCreator
           
 
Field Summary
static java.lang.String DBURL_KEY
           
static java.lang.String DEFAULT_PARSER
           
static java.lang.String DEFAULT_PROPS
           
protected  java.lang.String HSQL_FILE_URL
           
protected static NetworkArm network
           
static boolean RUN_ARMS
           
static java.lang.String TUTORIAL_LOC
           
 
Constructor Summary
Start(Args args)
          Creates a new Start instance set to use the XML config file in confFilename
Start(Args args, Start.InputSourceCreator sourceMaker, java.util.Properties props, boolean commandLineToolRun)
           
 
Method Summary
static void add(ArmListener listener)
           
static void add(java.util.Properties newProps)
           
static void addResultMailer(java.util.Properties mailProps)
           
 void allHopeAbandon(java.lang.String message)
           
static void armFailure(Arm arm, java.lang.Throwable t)
           
static void cataclysmicFailureOfUnbelievableProportions()
           
static void checkGCJ()
           
static org.w3c.dom.Document createDoc(org.xml.sax.InputSource source, java.lang.String filename)
           
static org.xml.sax.InputSource createInputSource(java.lang.ClassLoader cl, java.lang.String loc)
           
static java.io.InputStream createInputStream(java.lang.ClassLoader cl, java.lang.String loc)
           
static java.io.InputStream createInputStream(java.lang.String loc)
           
static RetryStrategy createRetryStrategy(int numRetries)
           
static void exit(java.lang.String reason)
           
static Args getArgs()
           
static org.w3c.dom.Element getConfig()
           
static java.lang.String getConfigFileName()
           
static TimeInterval getElapsedTime()
           
static EventArm getEventArm()
           
static NetworkArm getNetworkArm()
           
static ResultMailer getResultMailer()
           
static RunProperties getRunProps()
           
static MicroSecondDate getStartTime()
           
static AbstractWaveformRecipe getWaveformRecipe()
           
static void informUserOfBadNetworkAndExit(java.lang.String networkCode, NetworkNotFound nnf)
           
protected  void initDatabase()
           
static boolean isArmFailure()
           
static void main(java.lang.String[] args)
           
static void setCommandName(java.lang.String name)
           
static void setConfig(org.w3c.dom.Element config)
           
 void setupDatabaseForUnitTests()
           
 void start()
           
static void wakeUpAllArms()
           
protected  void warnIfDatabaseExists()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HSQL_FILE_URL

protected java.lang.String HSQL_FILE_URL

DEFAULT_PARSER

public static final java.lang.String DEFAULT_PARSER
See Also:
Constant Field Values

network

protected static NetworkArm network

DBURL_KEY

public static final java.lang.String DBURL_KEY
See Also:
Constant Field Values

RUN_ARMS

public static boolean RUN_ARMS

TUTORIAL_LOC

public static final java.lang.String TUTORIAL_LOC
See Also:
Constant Field Values

DEFAULT_PROPS

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

Start

public Start(Args args)
      throws java.lang.Exception
Creates a new Start instance set to use the XML config file in confFilename

Throws:
java.lang.Exception

Start

public Start(Args args,
             Start.InputSourceCreator sourceMaker,
             java.util.Properties props,
             boolean commandLineToolRun)
      throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

informUserOfBadNetworkAndExit

public static void informUserOfBadNetworkAndExit(java.lang.String networkCode,
                                                 NetworkNotFound nnf)

getStartTime

public static MicroSecondDate getStartTime()

getElapsedTime

public static TimeInterval getElapsedTime()

getConfigFileName

public static java.lang.String getConfigFileName()

setupDatabaseForUnitTests

public void setupDatabaseForUnitTests()
                               throws ConfigurationException
Throws:
ConfigurationException

initDatabase

protected void initDatabase()
                     throws ConfigurationException
Throws:
ConfigurationException

warnIfDatabaseExists

protected void warnIfDatabaseExists()

createInputSource

public static org.xml.sax.InputSource createInputSource(java.lang.ClassLoader cl,
                                                        java.lang.String loc)
                                                 throws java.io.IOException
Throws:
java.io.IOException

createInputStream

public static java.io.InputStream createInputStream(java.lang.String loc)
                                             throws java.io.IOException,
                                                    java.net.MalformedURLException,
                                                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.net.MalformedURLException
java.io.FileNotFoundException

createInputStream

public static java.io.InputStream createInputStream(java.lang.ClassLoader cl,
                                                    java.lang.String loc)
                                             throws java.io.IOException,
                                                    java.net.MalformedURLException,
                                                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.net.MalformedURLException
java.io.FileNotFoundException

createRetryStrategy

public static RetryStrategy createRetryStrategy(int numRetries)

setCommandName

public static void setCommandName(java.lang.String name)

setConfig

public static void setConfig(org.w3c.dom.Element config)

getWaveformRecipe

public static AbstractWaveformRecipe getWaveformRecipe()

getEventArm

public static EventArm getEventArm()

getNetworkArm

public static NetworkArm getNetworkArm()

getRunProps

public static RunProperties getRunProps()

createDoc

public static org.w3c.dom.Document createDoc(org.xml.sax.InputSource source,
                                             java.lang.String filename)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException,
                                             javax.xml.parsers.ParserConfigurationException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

getResultMailer

public static ResultMailer getResultMailer()
                                    throws ConfigurationException
Throws:
ConfigurationException

addResultMailer

public static void addResultMailer(java.util.Properties mailProps)
                            throws MissingPropertyException
Throws:
MissingPropertyException

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

allHopeAbandon

public void allHopeAbandon(java.lang.String message)

add

public static void add(ArmListener listener)

getArgs

public static Args getArgs()

getConfig

public static org.w3c.dom.Element getConfig()

checkGCJ

public static void checkGCJ()

main

public static void main(java.lang.String[] args)

exit

public static void exit(java.lang.String reason)

add

public static void add(java.util.Properties newProps)

cataclysmicFailureOfUnbelievableProportions

public static void cataclysmicFailureOfUnbelievableProportions()

armFailure

public static void armFailure(Arm arm,
                              java.lang.Throwable t)

wakeUpAllArms

public static void wakeUpAllArms()

isArmFailure

public static boolean isArmFailure()