KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > launching > IVMInstallType


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.launching;
13
14 import java.io.File JavaDoc;
15
16 import org.eclipse.core.runtime.IStatus;
17
18 /**
19  * Represents a particular type of VM for which there may be
20  * any number of VM installations. An example of a VM type
21  * is the standard JRE which might have instances corresponding
22  * to different installed versions such as JRE 1.2.2 and
23  * JRE 1.3.
24  * <p>
25  * This interface is intended to be implemented by clients that contribute
26  * to the <code>"org.eclipse.jdt.launching.vmType"</code> extension point.
27  * </p>
28  *
29  * @see IVMInstall
30  */

31 public interface IVMInstallType {
32     /**
33      * Creates a new instance of this VM Install type.
34      * The newly created IVMInstall is managed by this IVMInstallType.
35      *
36      * @param id An id String that must be unique within this IVMInstallType.
37      *
38      * @return the newly created VM instance
39      *
40      * @throws IllegalArgumentException If the id exists already.
41      */

42     IVMInstall createVMInstall(String JavaDoc id);
43     /**
44      * Finds the VM with the given id.
45      *
46      * @param id the VM id
47      * @return a VM instance, or <code>null</code> if not found
48      */

49     IVMInstall findVMInstall(String JavaDoc id);
50     /**
51      * Finds the VM with the given name.
52      *
53      * @param name the VM name
54      * @return a VM instance, or <code>null</code> if not found
55      * @since 2.0
56      */

57     IVMInstall findVMInstallByName(String JavaDoc name);
58     
59     /**
60      * Remove the VM associated with the given id from the set of VMs managed by
61      * this VM type. Has no effect if a VM with the given id is not currently managed
62      * by this type.
63      * A VM install that is disposed may not be used anymore.
64      *
65      * @param id the id of the VM to be disposed.
66      */

67     void disposeVMInstall(String JavaDoc id);
68     /**
69      * Returns all VM instances managed by this VM type.
70      *
71      * @return the list of VM instances managed by this VM type
72      */

73     IVMInstall[] getVMInstalls();
74     /**
75      * Returns the display name of this VM type.
76      *
77      * @return the name of this IVMInstallType
78      */

79     String JavaDoc getName();
80     
81     /**
82      * Returns the globally unique id of this VM type.
83      * Clients are responsible for providing a unique id.
84      *
85      * @return the id of this IVMInstallType
86      */

87     String JavaDoc getId();
88     /**
89      * Validates the given location of a VM installation.
90      * <p>
91      * For example, an implementation might check whether the VM executable
92      * is present.
93      * </p>
94      *
95      * @param installLocation the root directory of a potential installation for
96      * this type of VM
97      * @return a status object describing whether the install location is valid
98      */

99     IStatus validateInstallLocation(File JavaDoc installLocation);
100     
101     /**
102      * Tries to detect an installed VM that matches this VM install type.
103      * Typically, this method will detect the VM installation the
104      * Eclipse platform runs on. Implementers should return <code>null</code> if they
105      * can't assure that a given vm install matches this IVMInstallType.
106      * @return The location of an VM installation that can be used
107      * with this VM install type, or <code>null</code> if unable
108      * to locate an installed VM.
109      */

110     File JavaDoc detectInstallLocation();
111         
112     /**
113      * Returns a collection of <code>LibraryLocation</code>s that represent the
114      * default system libraries of this VM install type, if a VM was installed
115      * at the given <code>installLocation</code>.
116      * The returned <code>LibraryLocation</code>s may not exist if the
117      * <code>installLocation</code> is not a valid install location.
118      *
119      * @param installLocation home location
120      * @see LibraryLocation
121      * @see IVMInstallType#validateInstallLocation(File)
122      *
123      * @return default library locations based on the given <code>installLocation</code>.
124      * @since 2.0
125      */

126     LibraryLocation[] getDefaultLibraryLocations(File JavaDoc installLocation);
127 }
128
Popular Tags