public abstract class AbstractVMRunner extends java.lang.Object implements IVMRunner
Clients implementing VM runners should subclass this class.
IVMRunner| Constructor and Description |
|---|
AbstractVMRunner() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abort(java.lang.String message,
java.lang.Throwable exception,
int code)
Throws a core exception with an error status object built from
the given message, lower level exception, and error code.
|
protected java.lang.String[] |
combineVmArgs(VMRunnerConfiguration configuration,
IVMInstall vmInstall)
Combines and returns VM arguments specified by the runner configuration,
with those specified by the VM install, if any.
|
protected java.lang.Process |
exec(java.lang.String[] cmdLine,
java.io.File workingDirectory)
Executes the given command line using the given working directory
|
protected java.lang.Process |
exec(java.lang.String[] cmdLine,
java.io.File workingDirectory,
java.lang.String[] envp)
Executes the given command line using the given working directory and environment
|
protected java.lang.String |
getCmdLineAsString(java.lang.String[] cmdLine)
Returns the given array of strings as a single space-delimited string.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getDefaultProcessMap()
Returns the default process attribute map for Java processes.
|
protected abstract java.lang.String |
getPluginIdentifier()
Returns the identifier of the plug-in this VM runner
originated from.
|
protected boolean |
isModular(VMRunnerConfiguration config,
IVMInstall vmInstall)
Examines the project and install for presence of module and execution support.
|
protected IProcess |
newProcess(ILaunch launch,
java.lang.Process p,
java.lang.String label,
java.util.Map<java.lang.String,java.lang.String> attributes)
Returns a new process aborting if the process could not be created.
|
protected void abort(java.lang.String message,
java.lang.Throwable exception,
int code)
throws CoreException
message - the status messageexception - lower level exception associated with the
error, or null if nonecode - error codeCoreException - The exception encapsulating the reason for the abortprotected abstract java.lang.String getPluginIdentifier()
protected java.lang.Process exec(java.lang.String[] cmdLine,
java.io.File workingDirectory)
throws CoreException
cmdLine - the command lineworkingDirectory - the working directoryProcessCoreException - if the execution failsDebugPlugin#exec(String[], File)protected java.lang.Process exec(java.lang.String[] cmdLine,
java.io.File workingDirectory,
java.lang.String[] envp)
throws CoreException
cmdLine - the command lineworkingDirectory - the working directoryenvp - the environmentProcessCoreException - is the execution failsDebugPlugin#exec(String[], File, String[])protected java.lang.String getCmdLineAsString(java.lang.String[] cmdLine)
cmdLine - array of stringsprotected java.util.Map<java.lang.String,java.lang.String> getDefaultProcessMap()
protected IProcess newProcess(ILaunch launch,
java.lang.Process p,
java.lang.String label,
java.util.Map<java.lang.String,java.lang.String> attributes)
throws CoreException
launch - the launch the process is contained inp - the system process to wraplabel - the label assigned to the processattributes - values for the attribute mapCoreException - problems occurred creating the processprotected java.lang.String[] combineVmArgs(VMRunnerConfiguration configuration, IVMInstall vmInstall)
configuration - runner configurationvmInstall - VM installprotected boolean isModular(VMRunnerConfiguration config, IVMInstall vmInstall)
config - runner configurationvmInstall - VM installtrue if project is a module and uses JRE version 9 or more, or false otherwise