Package adams.tools
Class RunTool
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.run.RunScheme
-
- adams.run.RunDatabaseScheme
-
- adams.tools.RunTool
-
- All Implemented Interfaces:
Destroyable
,LoggingSupporter
,OptionHandler
,PasswordSupporter
,SizeOfHandler
,DatabaseConnectionEstablisher
,DatabaseConnectionParameterHandler
,Serializable
public class RunTool extends RunDatabaseScheme
Runs a tool from commandline. Valid options are:
-driver <java.lang.String> (property: driver) The JDBC driver. default: com.mysql.jdbc.Driver
-url <java.lang.String> (property: URL) The database URL.
-user <java.lang.String> (property: user) The database user.
-password <java.lang.String> (property: password) The password of the database user.
-tool <adams.tools.AbstractTool [options]> (property: tool) The tool to use. default: adams.tools.InitializeTables
Default options for adams.tools.InitializeTables (-tool/tool):-D (property: debug) If set to true, scheme may output additional info to the console.
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractTool
m_Tool
the tool to run.-
Fields inherited from class adams.run.RunDatabaseScheme
m_DbConn, m_Password, m_URL, m_User
-
Fields inherited from class adams.run.RunScheme
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description RunTool()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected void
doRun()
Runs the tool and prints some information to stdout.AbstractTool
getTool()
Returns the tool being used.static void
main(String[] args)
Runs the tool from commandline.protected void
preRun()
Performs some initializations before the actual run.void
setTool(AbstractTool value)
Sets the tool to run.String
toolTipText()
Returns the tip text for this property.-
Methods inherited from class adams.run.RunDatabaseScheme
establishDatabaseConnection, getPassword, getURL, getUser, initialize, passwordTipText, postRun, setPassword, setURL, setUser, URLTipText, userTipText
-
Methods inherited from class adams.run.RunScheme
cleanUpOptions, destroy, forCommandLine, forName, getOptionManager, newOptionManager, run, runScheme, toCommandLine
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Tool
protected AbstractTool m_Tool
the tool to run.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classRunDatabaseScheme
-
setTool
public void setTool(AbstractTool value)
Sets the tool to run.- Parameters:
value
- the tool
-
getTool
public AbstractTool getTool()
Returns the tool being used.- Returns:
- the tool
-
toolTipText
public String toolTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
preRun
protected void preRun() throws Exception
Performs some initializations before the actual run. Connects to the database.- Overrides:
preRun
in classRunDatabaseScheme
- Throws:
Exception
- if something goes wrong
-
doRun
protected void doRun() throws Exception
Runs the tool and prints some information to stdout.
-
main
public static void main(String[] args)
Runs the tool from commandline.- Parameters:
args
- the commandline arguments, use -help to display all
-
-