KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.net.URL JavaDoc;
16
17 /**
18  * Represents a particular installation of a VM. A VM instance holds all parameters
19  * specific to a VM installation. Unlike VM types, VM instances can be created and
20  * configured dynamically at run-time. This is typically done by the user
21  * interactively in the UI.
22  * <p>
23  * A VM install is responsible for creating VM runners to launch a Java program
24  * in a specific mode.
25  * </p>
26  * <p>
27  * This interface is intended to be implemented by clients that contribute
28  * to the <code>"org.eclipse.jdt.launching.vmInstallTypes"</code> extension point.
29  * Rather than implementing this interface directly, it is strongly recommended that
30  * clients subclass {@link org.eclipse.jdt.launching.AbstractVMInstall} to be insulated
31  * from potential API additions. In 3.1, a new optional interface has been added for
32  * implementors of this interface - {@link org.eclipse.jdt.launching.IVMInstall2}.
33  * The new interface is implemented by {@link org.eclipse.jdt.launching.AbstractVMInstall}.
34  * </p>
35  * @see org.eclipse.jdt.launching.IVMInstall2
36  */

37 public interface IVMInstall {
38     /**
39      * Returns a VM runner that runs this installed VM in the given mode.
40      *
41      * @param mode the mode the VM should be launched in; one of the constants
42      * declared in <code>org.eclipse.debug.core.ILaunchManager</code>
43      * @return a VMRunner for a given mode May return <code>null</code> if the given mode
44      * is not supported by this VM.
45      * @see org.eclipse.debug.core.ILaunchManager
46      */

47     IVMRunner getVMRunner(String JavaDoc mode);
48     /**
49      * Returns the id for this VM. VM IDs are unique within the VMs
50      * of a given VM type. The VM id is not intended to be presented to users.
51      *
52      * @return the VM identifier. Must not return <code>null</code>.
53      */

54     String JavaDoc getId();
55     /**
56      * Returns the display name of this VM.
57      * The VM name is intended to be presented to users.
58      *
59      * @return the display name of this VM. May return <code>null</code>.
60      */

61     String JavaDoc getName();
62     /**
63      * Sets the display name of this VM.
64      * The VM name is intended to be presented to users.
65      *
66      * @param name the display name of this VM
67      */

68     void setName(String JavaDoc name);
69     /**
70      * Returns the root directory of the install location of this VM.
71      *
72      * @return the root directory of this VM installation. May
73      * return <code>null</code>.
74      */

75     File JavaDoc getInstallLocation();
76     /**
77      * Sets the root directory of the install location of this VM.
78      *
79      * @param installLocation the root directory of this VM installation
80      */

81     void setInstallLocation(File JavaDoc installLocation);
82         
83     /**
84      * Returns the VM type of this VM.
85      *
86      * @return the VM type that created this IVMInstall instance
87      */

88     IVMInstallType getVMInstallType();
89     
90     /**
91      * Returns the library locations of this IVMInstall. Generally,
92      * clients should use <code>JavaRuntime.getLibraryLocations(IVMInstall)</code>
93      * to determine the libraries associated with this VM install.
94      *
95      * @see IVMInstall#setLibraryLocations(LibraryLocation[])
96      * @return The library locations of this IVMInstall.
97      * Returns <code>null</code> to indicate that this VM install uses
98      * the default library locations associated with this VM's install type.
99      * @since 2.0
100      */

101     LibraryLocation[] getLibraryLocations();
102     
103     /**
104      * Sets the library locations of this IVMInstall.
105      * @param locations The <code>LibraryLocation</code>s to associate
106      * with this IVMInstall.
107      * May be <code>null</code> to indicate that this VM install uses
108      * the default library locations associated with this VM's install type.
109      * @since 2.0
110      */

111     void setLibraryLocations(LibraryLocation[] locations);
112     
113     /**
114      * Sets the Javadoc location associated with this VM install.
115      *
116      * @param url a url pointing to the Javadoc location associated with
117      * this VM install
118      * @since 2.0
119      */

120     public void setJavadocLocation(URL JavaDoc url);
121     
122     /**
123      * Returns the Javadoc location associated with this VM install.
124      *
125      * @return a url pointing to the Javadoc location associated with
126      * this VM install, or <code>null</code> if none
127      * @since 2.0
128      */

129     public URL JavaDoc getJavadocLocation();
130     
131     /**
132      * Returns VM arguments to be used with this vm install whenever this
133      * VM is launched as they should be passed to the command line, or
134      * <code>null</code> if none.
135      *
136      * @return VM arguments to be used with this vm install whenever this
137      * VM is launched as they should be passed to the command line, or
138      * <code>null</code> if none
139      * @since 3.0
140      */

141     public String JavaDoc[] getVMArguments();
142     
143     /**
144      * Sets VM arguments to be used with this vm install whenever this
145      * VM is launched, possibly <code>null</code>. This is equivalent
146      * to <code>setVMArgs(String)</code> with whitespace character delimited
147      * arguments.
148      *
149      * @param vmArgs VM arguments to be used with this vm install whenever this
150      * VM is launched, possibly <code>null</code>
151      * @since 3.0
152      * @deprecated if possible, clients should use setVMArgs(String) on
153      * {@link IVMInstall2} when possible
154      */

155     public void setVMArguments(String JavaDoc[] vmArgs);
156         
157 }
158
Popular Tags