Package uk.ac.starlink.task
Class InvokeUtils
java.lang.Object
uk.ac.starlink.task.InvokeUtils
Provides some utility functions used by classes which invoke tasks.
- Since:
- 23 Jan 2007
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
configureLogging
(int verbosity, boolean debug) Sets up the logging system.static String
Returns the JVM version, without throwing any exceptions.static String
Returns the JVM name and version string, without throwing any exceptions.static void
Invokes the main method of a named class with logging configuration specified on the command line.static Parameter<?>[]
sortParameters
(Parameter<?>[] params) Sorts a list of Parameter objects.static void
summariseError
(Throwable error, PrintStream out) Writes a summary of a (possibly nested) exception to a given output stream.
-
Constructor Details
-
InvokeUtils
public InvokeUtils()
-
-
Method Details
-
configureLogging
public static void configureLogging(int verbosity, boolean debug) Sets up the logging system.- Parameters:
verbosity
- number of levels greater than default to setdebug
- whether debugging mode is on
-
getJavaVersion
Returns the JVM version, without throwing any exceptions.- Returns:
- java version
-
getJavaVM
Returns the JVM name and version string, without throwing any exceptions.- Returns:
- JVM description
-
summariseError
Writes a summary of a (possibly nested) exception to a given output stream.- Parameters:
error
- exceptionout
- destination stream
-
sortParameters
Sorts a list of Parameter objects. Numbered ones are followed by unnumbered ones.- Parameters:
params
- input list- Returns:
- output list
-
main
Invokes the main method of a named class with logging configuration specified on the command line. The -verbose/+verbose flags and the -debug flag may be supplied before the target classname and arguments.- Throws:
Throwable
-