com.glaivestone.javax.execution
Class SessionLauncher

java.lang.Object
  |
  +--com.glaivestone.javax.execution.SessionLauncher

public class SessionLauncher
extends java.lang.Object

Utility services for launching a session.

Provides facilities for initializing some session configuration options and launching a specified class (the main class of the application> Also includes some reporting utilities for dumping descriptions of the session configuration.

Since:
GFL 1.1
Author:
Deb Lewis

Field Summary
static SessionLauncher current
           
static java.lang.String DEFAULT_LIB_DIR
           
static java.lang.String[] EMPTY_APPLICATION_ARGUMENTS
           
static java.lang.String LIBRARY_PROPS_FILE
           
static java.lang.String[] LIBRARY_REPORT_ARGUMENTS
           
static java.lang.String OPTION_DUMP_CP
          No-arg option to dump the CLASSPATH during launch processing.
static java.lang.String OPTION_DUMP_LIBRARY_PROPS
          No-arg option to dump the library properties during launch processing.
static java.lang.String OPTION_DUMP_SYSTEM_PROPS
          No-arg option to dump the system properties during launch processing.
static java.lang.String OPTION_MAIN_CLASS
          Option whose value is the name of the class whose main method is to be run.
static java.lang.String OPTION_PREFIX
          Prefix character for command line options.
static java.lang.String OPTION_VERBOSE
          No-arg option to enable verbose tracing during launch processing.
static java.lang.String SECTION_SEPARATOR
           
static java.lang.String SYSTEM_PROP_NAME_CLASSPATH
           
 
Constructor Summary
SessionLauncher(java.lang.String[] arguments)
           
SessionLauncher(java.lang.String[] arguments, java.io.PrintStream reportStream)
           
 
Method Summary
 void describeClassPath(java.io.PrintStream ps)
          Dump a report on the current CLASSPATH entries.
 void describeLibraryProperties(java.io.PrintStream ps)
          Dump a report on the GFL library properties.
 void describeSystemProperties(java.util.List propertyNames, java.io.PrintStream ps)
          Dump a report on the specified system properties.
 void describeSystemProperties(java.io.PrintStream ps)
          Dump a report on the current system properties.
static void flushSystemStreams()
          Ensure that any output queued in the standard system output streams is flushed out of the write buffer to the destination.
 void initiateSession()
          Initiate the session by performing any initial configuration and invoking the main method of the main application class.
static void main(java.lang.String[] arguments)
           
 void runMain(java.lang.Class mainClass, java.lang.String[] args)
          Invoke the main(String[] args) method of the specified class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

public static SessionLauncher current

SYSTEM_PROP_NAME_CLASSPATH

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

OPTION_PREFIX

public static final java.lang.String OPTION_PREFIX
Prefix character for command line options.

See Also:
Constant Field Values

OPTION_VERBOSE

public static final java.lang.String OPTION_VERBOSE
No-arg option to enable verbose tracing during launch processing.

See Also:
Constant Field Values

OPTION_DUMP_CP

public static final java.lang.String OPTION_DUMP_CP
No-arg option to dump the CLASSPATH during launch processing.

See Also:
Constant Field Values

OPTION_DUMP_SYSTEM_PROPS

public static final java.lang.String OPTION_DUMP_SYSTEM_PROPS
No-arg option to dump the system properties during launch processing.

See Also:
Constant Field Values

OPTION_DUMP_LIBRARY_PROPS

public static final java.lang.String OPTION_DUMP_LIBRARY_PROPS
No-arg option to dump the library properties during launch processing.

See Also:
Constant Field Values

OPTION_MAIN_CLASS

public static final java.lang.String OPTION_MAIN_CLASS
Option whose value is the name of the class whose main method is to be run.

See Also:
Constant Field Values

DEFAULT_LIB_DIR

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

LIBRARY_PROPS_FILE

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

EMPTY_APPLICATION_ARGUMENTS

public static final java.lang.String[] EMPTY_APPLICATION_ARGUMENTS

LIBRARY_REPORT_ARGUMENTS

public static final java.lang.String[] LIBRARY_REPORT_ARGUMENTS

SECTION_SEPARATOR

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

SessionLauncher

public SessionLauncher(java.lang.String[] arguments)

SessionLauncher

public SessionLauncher(java.lang.String[] arguments,
                       java.io.PrintStream reportStream)
Method Detail

describeClassPath

public void describeClassPath(java.io.PrintStream ps)
Dump a report on the current CLASSPATH entries.


describeLibraryProperties

public void describeLibraryProperties(java.io.PrintStream ps)
Dump a report on the GFL library properties.


describeSystemProperties

public void describeSystemProperties(java.io.PrintStream ps)
Dump a report on the current system properties.


describeSystemProperties

public void describeSystemProperties(java.util.List propertyNames,
                                     java.io.PrintStream ps)
Dump a report on the specified system properties.


flushSystemStreams

public static void flushSystemStreams()
Ensure that any output queued in the standard system output streams is flushed out of the write buffer to the destination.


initiateSession

public void initiateSession()
Initiate the session by performing any initial configuration and invoking the main method of the main application class.


runMain

public void runMain(java.lang.Class mainClass,
                    java.lang.String[] args)
Invoke the main(String[] args) method of the specified class.


main

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

GFL 1.1 API