org.eclipse.wst.jsdt.launching

## Class VMRunnerConfiguration

- java.lang.Object
- - org.eclipse.wst.jsdt.launching.VMRunnerConfiguration

    public class VMRunnerConfiguration
    extends java.lang.Object

Holder for various arguments passed to a VM runner. Mandatory parameters are passed in the constructor; optional arguments, via setters.

Clients may instantiate this class; it is not intended to be subclassed.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Constructor Summary

Constructors
Constructor and Description
`VMRunnerConfiguration(java.lang.String classToLaunch, java.lang.String[] classPath)` Creates a new configuration for launching a VM to run the given main class using the given class path.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String[]` `getBootClassPath()` Returns the boot includepath.
`java.lang.String[]` `getClassPath()` Returns the includepath.
`java.lang.String` `getClassToLaunch()` Returns the name of the class to launch.
`java.lang.String[]` `getEnvironment()` Returns the environment for the JavaScript program or `null`
`java.lang.String[]` `getProgramArguments()` Returns the arguments to the JavaScript program.
`java.lang.String[]` `getVMArguments()` Returns the arguments to the VM itself.
`java.util.Map` `getVMSpecificAttributesMap()` Returns the `Map` that contains String name/value pairs that represent VM-specific attributes.
`java.lang.String` `getWorkingDirectory()` Returns the working directory of a launched VM.
`boolean` `isResumeOnStartup()` Returns whether the VM is resumed on startup when launched in debug mode.
`void` `setBootClassPath(java.lang.String[] bootClassPath)` Sets the boot includepath.
`void` `setEnvironment(java.lang.String[] environment)` Sets the environment for the JavaScript program.
`void` `setProgramArguments(java.lang.String[] args)` Sets the custom program arguments.
`void` `setResumeOnStartup(boolean resume)` Sets whether the VM is resumed on startup when launched in debug mode.
`void` `setVMArguments(java.lang.String[] args)` Sets the custom VM arguments.
`void` `setVMSpecificAttributesMap(java.util.Map map)` Sets the `Map` that contains String name/value pairs that represent VM-specific attributes.
`void` `setWorkingDirectory(java.lang.String path)` Sets the working directory for a launched VM.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### VMRunnerConfiguration

    public VMRunnerConfiguration(java.lang.String classToLaunch,
                                 java.lang.String[] classPath)

Creates a new configuration for launching a VM to run the given main class using the given class path.

Parameters:
  `classToLaunch` - The fully qualified name of the class to launch. May not be null.
  `classPath` - The includepath. May not be null.

### Method Detail

#### setVMSpecificAttributesMap

    public void setVMSpecificAttributesMap(java.util.Map map)

Sets the `Map` that contains String name/value pairs that represent VM-specific attributes.

Parameters:
  `map` - the `Map` of VM-specific attributes.

#### setVMArguments

    public void setVMArguments(java.lang.String[] args)

Sets the custom VM arguments. These arguments will be appended to the list of VM arguments that a VM runner uses when launching a VM. Typically, these VM arguments are set by the user. These arguments will not be interpreted by a VM runner, the client is responsible for passing arguments compatible with a particular VM runner.

Parameters:
  `args` - the list of VM arguments

#### setProgramArguments

    public void setProgramArguments(java.lang.String[] args)

Sets the custom program arguments. These arguments will be appended to the list of program arguments that a VM runner uses when launching a VM (in general: none). Typically, these VM arguments are set by the user. These arguments will not be interpreted by a VM runner, the client is responsible for passing arguments compatible with a particular VM runner.

Parameters:
  `args` - the list of arguments

#### setEnvironment

    public void setEnvironment(java.lang.String[] environment)

Sets the environment for the JavaScript program. The JavaScript VM will be launched in the given environment.

Parameters:
  `environment` - the environment for the JavaScript program specified as an array of strings, each element specifying an environment variable setting in the format name=value

#### setBootClassPath

    public void setBootClassPath(java.lang.String[] bootClassPath)

Sets the boot includepath. Note that the boot includepath will be passed to the VM "as is". This means it has to be complete. Interpretation of the boot class path is up to the VM runner this object is passed to.

In release 3.0, support has been added for appending and prepending the boot includepath. Generally an `IVMRunner` should use the prepend, main, and append boot includepaths provided. However, in the case that an `IVMRunner` does not support these options, a complete bootpath should also be specified.

Parameters:
  `bootClassPath` - The boot includepath. An empty array indicates an empty bootpath and `null` indicates a default bootpath.

#### getVMSpecificAttributesMap

    public java.util.Map getVMSpecificAttributesMap()

Returns the `Map` that contains String name/value pairs that represent VM-specific attributes.

Returns:
  The `Map` of VM-specific attributes or `null`.

#### getClassToLaunch

    public java.lang.String getClassToLaunch()

Returns the name of the class to launch.

Returns:
  The fully qualified name of the class to launch. Will not be `null`.

#### getClassPath

    public java.lang.String[] getClassPath()

Returns the includepath.

Returns:
  the includepath

#### getBootClassPath

    public java.lang.String[] getBootClassPath()

Returns the boot includepath. An empty array indicates an empty bootpath and `null` indicates a default bootpath.

In 3.0, support has been added for prepending and appending to the boot includepath. The new attributes are stored in the VM specific attributes map using the following keys defined in `IJavaLaunchConfigurationConstants`:

- ATTR_BOOTPATH_PREPEND
- ATTR_BOOTPATH_APPEND
- ATTR_BOOTPATH

Returns:
  The boot includepath. An empty array indicates an empty bootpath and `null` indicates a default bootpath.
See Also:
  `setBootClassPath(String[])`, `IJavaLaunchConfigurationConstants`

#### getVMArguments

    public java.lang.String[] getVMArguments()

Returns the arguments to the VM itself.

Returns:
  The VM arguments. Default is an empty array. Will not be `null`.
See Also:
  `setVMArguments(String[])`

#### getProgramArguments

    public java.lang.String[] getProgramArguments()

Returns the arguments to the JavaScript program.

Returns:
  The JavaScript program arguments. Default is an empty array. Will not be `null`.
See Also:
  `setProgramArguments(String[])`

#### getEnvironment

    public java.lang.String[] getEnvironment()

Returns the environment for the JavaScript program or `null`

Returns:
  The JavaScript program environment. Default is `null`

#### setWorkingDirectory

    public void setWorkingDirectory(java.lang.String path)

Sets the working directory for a launched VM.

Parameters:
  `path` - the absolute path to the working directory to be used by a launched VM, or `null` if the default working directory is to be inherited from the current process

#### getWorkingDirectory

    public java.lang.String getWorkingDirectory()

Returns the working directory of a launched VM.

Returns:
  the absolute path to the working directory of a launched VM, or `null` if the working directory is inherited from the current process

#### setResumeOnStartup

    public void setResumeOnStartup(boolean resume)

Sets whether the VM is resumed on startup when launched in debug mode. Has no effect when not in debug mode.

Parameters:
  `resume` - whether to resume the VM on startup

#### isResumeOnStartup

    public boolean isResumeOnStartup()

Returns whether the VM is resumed on startup when launched in debug mode. Has no effect when no in debug mode. Default value is `true` for backwards compatibility.

Returns:
  whether to resume the VM on startup