java.lang.Runnable
public class Launcher
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field | Description |
---|---|---|
static java.lang.Object[] |
SUPPORTED_ANT_TASKS |
List of supported Ant tasks.
|
static java.lang.Object[] |
SUPPORTED_ANT_TYPES |
List of supported Ant types.
|
Constructor | Description |
---|---|
Launcher() |
Modifier and Type | Method | Description |
---|---|---|
static void |
error(java.lang.String message,
boolean usage) |
Print a detailed error message and exit.
|
static void |
error(java.lang.Throwable t) |
Print a detailed error message and exit.
|
static java.io.File |
getBootstrapDir() |
Get the canonical directory of the class or jar file that this class was
loaded.
|
static java.io.File |
getBootstrapFile() |
Get the canonical directory or jar file that this class was loaded
from.
|
static java.lang.String |
getJavaCommand() |
Get the full path of the Java command to execute.
|
static java.lang.String |
getJDBCommand() |
Get the full path of the JDB command to execute.
|
static java.lang.String |
getLocalizedString(java.lang.String key) |
Get a localized property.
|
static java.lang.String |
getLocalizedString(java.lang.String key,
java.lang.String className) |
Get a localized property.
|
static java.io.PrintStream |
getLog() |
Get the PrintStream that all output should printed to.
|
static java.lang.String |
getToolsClasspath() |
Set the classpath to the current JVM's tools classes.
|
static boolean |
isStarted() |
Get the started flag.
|
static boolean |
isStopped() |
Get the stopped flag.
|
static void |
killChildProcesses() |
Iterate through the list of synchronous child process launched by
all of the
LaunchTask instances. |
void |
run() |
Wrapper to allow the
killChildProcesses() method to be
invoked in a shutdown hook. |
static void |
setLog(java.io.PrintStream log) |
Set the PrintStream that all output should printed to.
|
static void |
setVerbose(boolean verbose) |
Set the verbose flag.
|
static int |
start(java.lang.String[] args) |
Start the launching process.
|
static boolean |
stop() |
Interrupt the
start(String[]) method. |
public static final java.lang.Object[] SUPPORTED_ANT_TASKS
public static final java.lang.Object[] SUPPORTED_ANT_TYPES
public static boolean isStarted()
public static boolean isStopped()
public static int start(java.lang.String[] args) throws java.lang.IllegalArgumentException
main(String[]) method for this class except that this method
never invokes System.exit(int)
. This method is designed for
applications that wish to invoke this class directly from within their
application's code.
args
- command line argumentsjava.lang.IllegalArgumentException
- if any error parsing the args parameter
occurspublic static boolean stop()
start(String[])
method. This is done
by forcing the current or next scheduled invocation of the
LaunchTask.execute()
method to throw an exception. In addition,
this method will terminate any synchronous child processes that any
instances of the LaunchTask
class have launched. Note, however,
that this method will not terminate any asynchronous child
processes that have been launched. Accordingly, applications that use
this method are encouraged to always set the LaunchTask.TASK_NAME task's
"waitForChild" attribute to "true" to ensure that the
application that you want to control can be terminated via this method.
After this method has been executed, it will not return until is safe to
execute the start(String[])
method.public static void error(java.lang.String message, boolean usage)
message
- the message to be printedusage
- if true, print a usage statement after the messagepublic static void error(java.lang.Throwable t)
message
- the exception whose stack trace is to be printed.public static java.io.File getBootstrapDir() throws java.io.IOException
java.io.IOException
- if the canonical directory or jar file
cannot be foundpublic static java.io.File getBootstrapFile() throws java.io.IOException
java.io.IOException
- if the canonical directory or jar file
cannot be foundpublic static java.lang.String getJavaCommand()
public static java.lang.String getJDBCommand()
public static java.io.PrintStream getLog()
public static java.lang.String getToolsClasspath() throws java.io.IOException
java.io.IOException
- if the tools classes cannot be foundpublic static java.lang.String getLocalizedString(java.lang.String key)
key
- the localized property to retrievepublic static java.lang.String getLocalizedString(java.lang.String key, java.lang.String className)
key
- the localized property to retrieveclassName
- the name of the class to retrieve the property forpublic static void setLog(java.io.PrintStream log)
a
- PrintStream instance to print output topublic static void setVerbose(boolean verbose)
verbose
- the value of the verbose flagpublic static void killChildProcesses()
LaunchTask
instances.public void run()
killChildProcesses()
method to be
invoked in a shutdown hook.run
in interface java.lang.Runnable
Copyright (c) 2001-2002 - Apache Software Foundation