public class StandardVMRunner extends AbstractVMRunner
| Modifier and Type | Class and Description |
|---|---|
protected static class |
StandardVMRunner.CommandDetails |
| Modifier and Type | Field and Description |
|---|---|
protected IVMInstall |
fVMInstance
The VM install instance
|
static java.lang.String |
XSTART_ON_FIRST_THREAD
Constant representing the
-XstartOnFirstThread VM argument |
| Constructor and Description |
|---|
StandardVMRunner(IVMInstall vmInstance)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addArguments(java.lang.String[] args,
java.util.List<java.lang.String> v)
Adds the array of
Strings to the given List |
protected void |
addBootClassPathArguments(java.util.List<java.lang.String> arguments,
VMRunnerConfiguration config)
Adds arguments to the bootpath
|
protected java.lang.String |
constructProgramString(VMRunnerConfiguration config)
Construct and return a String containing the full path of a java executable
command such as 'java' or 'javaw.exe'.
|
protected java.lang.String |
convertClassPath(java.lang.String[] cp) |
protected java.lang.String[] |
ensureEncoding(ILaunch launch,
java.lang.String[] vmargs)
This method is used to ensure that the JVM file encoding matches that of the console preference for file encoding.
|
protected boolean |
fileExists(java.io.File file)
Convenience method to determine if the specified file exists or not
|
protected double |
getJavaVersion(IVMInstall fVMInstance)
Returns the version of the current VM in use
|
protected java.lang.String |
getPluginIdentifier()
Returns the identifier of the plug-in this VM runner
originated from.
|
protected java.io.File |
getWorkingDir(VMRunnerConfiguration config)
Returns the working directory to use for the launched VM,
or
null if the working directory is to be inherited
from the current process. |
protected java.lang.String[] |
prependJREPath(java.lang.String[] env)
Prepends the correct java version variable state to the environment path for Mac VMs
|
protected java.lang.String |
renderCommandLine(java.lang.String[] commandLine)
Prepares the command line from the specified array of strings
|
protected java.lang.String |
renderDebugTarget(java.lang.String classToRun,
int host)
Returns the 'rendered' name for the current target
|
static java.lang.String |
renderProcessLabel(java.lang.Process p,
java.lang.String[] commandLine,
java.lang.String timestamp)
Returns the 'rendered' name for the specified command line
|
void |
run(VMRunnerConfiguration config,
ILaunch launch,
IProgressMonitor monitor)
Launches a Java VM as specified in the given configuration,
contributing results (debug targets and processes), to the
given launch.
|
java.lang.String |
showCommandLine(VMRunnerConfiguration configuration,
ILaunch launch,
IProgressMonitor monitor)
Gets the command line required to launch a Java VM as specified in the given configuration, contributing results (debug targets and processes),
to the given launch.
|
protected java.lang.String[] |
validateCommandLine(ILaunchConfiguration configuration,
java.lang.String[] cmdLine)
This method allows consumers to have a last look at the command line that will be used
to start the runner just prior to launching.
|
abort, combineVmArgs, exec, exec, exec, getCmdLineAsString, getDefaultProcessMap, isModular, newProcess, quoteWindowsArgspublic static final java.lang.String XSTART_ON_FIRST_THREAD
-XstartOnFirstThread VM argumentprotected IVMInstall fVMInstance
public StandardVMRunner(IVMInstall vmInstance)
vmInstance - the VMprotected java.lang.String renderDebugTarget(java.lang.String classToRun,
int host)
classToRun - the classhost - the host namepublic static java.lang.String renderProcessLabel(java.lang.Process p,
java.lang.String[] commandLine,
java.lang.String timestamp)
p - commandLine - the command linetimestamp - the run-at time for the processprotected java.lang.String renderCommandLine(java.lang.String[] commandLine)
commandLine - the command lineprotected void addArguments(java.lang.String[] args,
java.util.List<java.lang.String> v)
Strings to the given Listargs - the stringsv - the listprotected java.lang.String[] validateCommandLine(ILaunchConfiguration configuration,
java.lang.String[] cmdLine)
null if the existing command line should be used.
null indicating that the existing command line should be used to launchconfiguration - the backing ILaunchConfigurationcmdLine - the existing command linenull if the existing one should be usedprotected java.io.File getWorkingDir(VMRunnerConfiguration config) throws CoreException
null if the working directory is to be inherited
from the current process.config - the VM configurationCoreException - if the working directory specified by
the configuration does not exist or is not a directoryprotected java.lang.String getPluginIdentifier()
AbstractVMRunnergetPluginIdentifier in class AbstractVMRunnerprotected java.lang.String constructProgramString(VMRunnerConfiguration config) throws CoreException
config - the runner configurationCoreException - if unable to locate an executableprotected boolean fileExists(java.io.File file)
file - the file to checkprotected java.lang.String convertClassPath(java.lang.String[] cp)
protected java.lang.String[] ensureEncoding(ILaunch launch,
java.lang.String[] vmargs)
launch - the Launchvmargs - the original listing of JVM argumentspublic java.lang.String showCommandLine(VMRunnerConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException
IVMRunnerconfiguration - the configuration settings for this runlaunch - the launch to contribute tomonitor - progress monitor or null A cancelable progress monitor is provided by the Job framework. It should be noted that the
setCanceled(boolean) method should never be called on the provided monitor or the monitor passed to any delegates from this method;
due to a limitation in the progress monitor framework using the setCanceled method can cause entire workspace batch jobs to be
canceled, as the canceled flag is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been
started.CoreException - if an exception occurs while getting the command linepublic void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException
IVMRunnerconfig - the configuration settings for this runlaunch - the launch to contribute tomonitor - progress monitor or null A cancelable progress monitor is provided by the Job
framework. It should be noted that the setCanceled(boolean) method should never be called on the provided
monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor
framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag
is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started.CoreException - if an exception occurs while launchingprotected java.lang.String[] prependJREPath(java.lang.String[] env)
env - the current array of environment variables to run withprotected void addBootClassPathArguments(java.util.List<java.lang.String> arguments,
VMRunnerConfiguration config)
arguments - the argumentsconfig - the VM configprotected double getJavaVersion(IVMInstall fVMInstance)