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 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