org.eclipse.wst.jsdt.launching

## Class AbstractVMInstallType

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

All Implemented Interfaces:
  IVMInstallType

Direct Known Subclasses:
  StandardVMType

    public abstract class AbstractVMInstallType
    extends java.lang.Object
    implements IVMInstallType

Abstract implementation of a VM install type. Subclasses should implement

- `IVMInstall doCreateVMInstall(String id)`
- `String getName()`
- `IStatus validateInstallLocation(File installLocation)`

Clients implementing VM install types should subclass this class.

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
`protected` `AbstractVMInstallType()` Constructs a new VM install type.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`IVMInstall` `createVMInstall(java.lang.String id)` Creates a new instance of this VM Install type.
`void` `disposeVMInstall(java.lang.String id)` Remove the VM associated with the given id from the set of VMs managed by this VM type.
`protected abstract IVMInstall` `doCreateVMInstall(java.lang.String id)` Subclasses should return a new instance of the appropriate `IVMInstall` subclass from this method.
`IVMInstall` `findVMInstall(java.lang.String id)` Finds the VM with the given id.
`IVMInstall` `findVMInstallByName(java.lang.String name)` Finds the VM with the given name.
`java.net.URL` `getDefaultJavadocLocation(java.io.File installLocation)` Returns a URL for the default jsdoc location of a VM installed at the given home location, or `null` if none.
`java.lang.String` `getId()` Returns the globally unique id of this VM type.
`IVMInstall[]` `getVMInstalls()` Returns all VM instances managed by this VM type.
`void` `setInitializationData(IConfigurationElement config, java.lang.String propertyName, java.lang.Object data)` Initializes the id parameter from the "id" attribute in the configuration markup.

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

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

### Methods inherited from interface org.eclipse.wst.jsdt.launching.IVMInstallType

`detectInstallLocation, getDefaultLibraryLocations, getName, validateInstallLocation`

### Constructor Detail

#### AbstractVMInstallType

    protected AbstractVMInstallType()

Constructs a new VM install type.

### Method Detail

#### getVMInstalls

    public IVMInstall[] getVMInstalls()

Description copied from interface: `IVMInstallType`
Returns all VM instances managed by this VM type.

Specified by:
  `getVMInstalls` in interface `IVMInstallType`
Returns:
  the list of VM instances managed by this VM type

#### disposeVMInstall

    public void disposeVMInstall(java.lang.String id)

Description copied from interface: `IVMInstallType`
Remove the VM associated with the given id from the set of VMs managed by this VM type. Has no effect if a VM with the given id is not currently managed by this type. A VM install that is disposed may not be used anymore.

Specified by:
  `disposeVMInstall` in interface `IVMInstallType`
Parameters:
  `id` - the id of the VM to be disposed.

#### findVMInstall

    public IVMInstall findVMInstall(java.lang.String id)

Description copied from interface: `IVMInstallType`
Finds the VM with the given id.

Specified by:
  `findVMInstall` in interface `IVMInstallType`
Parameters:
  `id` - the VM id
Returns:
  a VM instance, or `null` if not found

#### createVMInstall

    public IVMInstall createVMInstall(java.lang.String id)
                               throws java.lang.IllegalArgumentException

Description copied from interface: `IVMInstallType`
Creates a new instance of this VM Install type. The newly created IVMInstall is managed by this IVMInstallType.

Specified by:
  `createVMInstall` in interface `IVMInstallType`
Parameters:
  `id` - An id String that must be unique within this IVMInstallType.
Returns:
  the newly created VM instance
Throws:
  `java.lang.IllegalArgumentException` - If the id exists already.

#### doCreateVMInstall

    protected abstract IVMInstall doCreateVMInstall(java.lang.String id)

Subclasses should return a new instance of the appropriate `IVMInstall` subclass from this method.

Parameters:
  `id` - The vm's id. The `IVMInstall` instance that is created must return `id` from its `getId()` method. Must not be `null`.
Returns:
  the newly created IVMInstall instance. Must not return `null`.

#### setInitializationData

    public void setInitializationData(IConfigurationElement config,
                                      java.lang.String propertyName,
                                      java.lang.Object data)

Initializes the id parameter from the "id" attribute in the configuration markup. Subclasses should not override this method.

Parameters:
  `config` - the configuration element used to trigger this execution. It can be queried by the executable extension for specific configuration properties
  `propertyName` - the name of an attribute of the configuration element used on the `createExecutableExtension(String)` call. This argument can be used in the cases where a single configuration element is used to define multiple executable extensions.
  `data` - adapter data in the form of a `String`, a `Hashtable`, or `null`.
See Also:
  `org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)`

#### getId

    public java.lang.String getId()

Description copied from interface: `IVMInstallType`
Returns the globally unique id of this VM type. Clients are responsible for providing a unique id.

Specified by:
  `getId` in interface `IVMInstallType`
Returns:
  the id of this IVMInstallType

#### findVMInstallByName

    public IVMInstall findVMInstallByName(java.lang.String name)

Description copied from interface: `IVMInstallType`
Finds the VM with the given name.

Specified by:
  `findVMInstallByName` in interface `IVMInstallType`
Parameters:
  `name` - the VM name
Returns:
  a VM instance, or `null` if not found

#### getDefaultJavadocLocation

    public java.net.URL getDefaultJavadocLocation(java.io.File installLocation)

Returns a URL for the default jsdoc location of a VM installed at the given home location, or `null` if none. The default implementation returns `null`, subclasses must override as appropriate.

Note, this method would ideally be added to `IVMInstallType`, but it would have been a breaking API change between 2.0 and 2.1. Thus, it has been added to the abstract base class that VM install types should subclass.

Parameters:
  `installLocation` - home location
Returns:
  default jsdoc location or `null`