001: /*******************************************************************************
002: * Copyright (c) 2005, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.launching.environments;
011:
012: import org.eclipse.jdt.core.IAccessRule;
013: import org.eclipse.jdt.core.IJavaProject;
014: import org.eclipse.jdt.launching.IVMInstall;
015: import org.eclipse.jdt.launching.LibraryLocation;
016:
017: /**
018: * An execution environment describes capabilities of
019: * a Java runtime environment (<code>IVMInstall</code>).
020: * <p>
021: * An execution environment is contributed in plug-in XML via the
022: * <code>org.eclipse.jdt.launching.executionEnvironments</code> extension
023: * point.
024: * </p>
025: * <p>
026: * This interface is not intended to be implemented. Clients contributing
027: * execution environments may provide and implement execution environment
028: * analyzer delegates.
029: * </p>
030: * @since 3.2
031: * @see IExecutionEnvironmentAnalyzerDelegate
032: */
033: public interface IExecutionEnvironment {
034:
035: /**
036: * Returns a unique identifier for this execution environment.
037: * Corresponds to the <code>id</code> attribute in plug-in XML.
038: *
039: * @return unique identifier of this execution environment
040: */
041: public String getId();
042:
043: /**
044: * Returns a brief human-readable description of this environment.
045: *
046: * @return brief human-readable description of this environment.
047: */
048: public String getDescription();
049:
050: /**
051: * Returns a collection of vm installs compatible with this environment,
052: * possibly empty.
053: *
054: * @return a collection of vm installs compatible with this environment,
055: * possibly empty.
056: */
057: public IVMInstall[] getCompatibleVMs();
058:
059: /**
060: * Returns whether the specified vm install is strictly compatible with
061: * this environment. Returns <code>true</code> to indicate the vm install
062: * is strictly compatible with this environment and <code>false</code> to indicate
063: * the vm install represents a superset of this environment.
064: *
065: * @param vm vm install
066: * @return whether the vm install is strictly compatible with this environment
067: */
068: public boolean isStrictlyCompatible(IVMInstall vm);
069:
070: /**
071: * Returns the vm that is used by default for this execution environment,
072: * or <code>null</code> if none.
073: *
074: * @return default vm for this environment or <code>null</code> if none
075: */
076: public IVMInstall getDefaultVM();
077:
078: /**
079: * Sets the vm to use by default for this execution environment.
080: *
081: * @param vm vm to use by default for this execution environment,
082: * or <code>null</code> to clear the default setting
083: * @exception IllegalArgumentException if the given vm is not compatible with
084: * this environment
085: */
086: public void setDefaultVM(IVMInstall vm);
087:
088: /**
089: * Returns a collection of access rules to be applied to the specified VM
090: * libraries for this execution environment in the context of the given project.
091: * An array of access rules is returned for each library specified by
092: * <code>libraries</code>, possibly empty.
093: * <p>
094: * Access rules for an execution environment are defined by access rule participants
095: * contributed in a <code>org.eclipse.jdt.launching.executionEnvironments</code>
096: * extension.
097: * </p>
098: * @param vm the vm that access rules are requested for
099: * @param libraries the libraries that access rules are requested for
100: * @param project the project the access rules are requested for or <code>null</code> if none
101: * @return a collection of arrays of access rules - one array per library
102: * @since 3.3
103: */
104: public IAccessRule[][] getAccessRules(IVMInstall vm,
105: LibraryLocation[] libraries, IJavaProject project);
106: }
|