# Class InvokeUtils

java.lang.Object
uk.ac.starlink.task.InvokeUtils

public class InvokeUtils extends Object
Provides some utility functions used by classes which invoke tasks.

Since:
  23 Jan 2007
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`InvokeUtils()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`configureLogging(int verbosity, boolean debug)`
Sets up the logging system.
`static String`
`getJavaVersion()`
Returns the JVM version, without throwing any exceptions.
`static String`
`getJavaVM()`
Returns the JVM name and version string, without throwing any exceptions.
`static void`
`main(String[] args)`
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.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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 set
  `debug` - whether debugging mode is on

### getJavaVersion

public static String getJavaVersion()
Returns the JVM version, without throwing any exceptions.

Returns:
  java version

### getJavaVM

public static String getJavaVM()
Returns the JVM name and version string, without throwing any exceptions.

Returns:
  JVM description

### summariseError

public static void summariseError(Throwable error, PrintStream out)
Writes a summary of a (possibly nested) exception to a given output stream.

Parameters:
  `error` - exception
  `out` - destination stream

### sortParameters

public static Parameter<?>[] sortParameters(Parameter<?>[] params)
Sorts a list of Parameter objects. Numbered ones are followed by unnumbered ones.

Parameters:
  `params` - input list
Returns:
  output list

### main

public static void main(String[] args) throws Throwable
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`