001: /*******************************************************************************
002: * Copyright (c) 2000, 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;
011:
012: import org.eclipse.core.runtime.CoreException;
013: import org.eclipse.debug.core.ILaunchConfiguration;
014: import org.eclipse.jdt.core.IClasspathEntry;
015: import org.eclipse.jdt.core.IJavaProject;
016:
017: /**
018: * Resolves variable and/or container runtime classpath entries in
019: * the context of a launch configuration or Java project. A resolver can be declared
020: * as an extension (<code>org.eclipse.jdt.launching.runtimeClasspathEntryResolver</code>),
021: * or be registered with the <code>JavaRuntime</code> programmatically.
022: * <p>
023: * A resolver is registered for a specific classpath
024: * <code>VARIABLE</code> and/or <code>CONTAINER</code>. A resolver is
025: * consulted when a runtime classpath entry is needs to be resolved.
026: * </p>
027: * A resolver extension is defined in <code>plugin.xml</code>.
028: * Following is an example definition of a runtime classpath entry
029: * resolver extension.
030: * <pre>
031: * <extension point="org.eclipse.jdt.launching.runtimeClasspathEntryResolvers">
032: * <runtimeClasspathEntryResolver
033: * id="com.example.ExampleResolver"
034: * class="com.example.ExampleResolverImpl"
035: * variable="VAR_NAME"
036: * container="CONTAINER_ID"
037: * </runtimeClasspathEntryResolver>
038: * </extension>
039: * </pre>
040: * The attributes are specified as follows:
041: * <ul>
042: * <li><code>id</code> specifies a unique identifier for this extension.</li>
043: * <li><code>class</code> specifies the fully qualified name of the Java class
044: * that implements <code>IRuntimeClasspathEntryResolver</code>.</li>
045: * <li><code>variable</code> name of the classpath variable this resolver
046: * is registered for.</li>
047: * <li><code>container</code> identifier of the classpath container this
048: * resolver is registered for.</li>
049: * </ul>
050: * At least one of <code>variable</code> or <code>container</code> must be
051: * specified.
052: * </p>
053: * <p>
054: * Clients may implement this interface.
055: * </p>
056: * @since 2.0
057: */
058: public interface IRuntimeClasspathEntryResolver {
059:
060: /**
061: * Returns resolved runtime classpath entries for the given runtime classpath entry,
062: * in the context of the given launch configuration.
063: *
064: * @param entry runtime classpath entry to resolve, of type
065: * <code>VARIABLE</code> or <code>CONTAINTER</code>
066: * @param configuration the context in which the runtime classpath entry
067: * needs to be resolved
068: * @return resolved entries (zero or more)
069: * @exception CoreException if unable to resolve the entry
070: */
071: public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(
072: IRuntimeClasspathEntry entry,
073: ILaunchConfiguration configuration) throws CoreException;
074:
075: /**
076: * Returns resolved runtime classpath entries for the given runtime classpath entry,
077: * in the context of the given Java project.
078: *
079: * @param entry runtime classpath entry to resolve, of type
080: * <code>VARIABLE</code> or <code>CONTAINTER</code>
081: * @param project context in which the runtime classpath entry
082: * needs to be resolved
083: * @return resolved entries (zero or more)
084: * @exception CoreException if unable to resolve the entry
085: */
086: public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(
087: IRuntimeClasspathEntry entry, IJavaProject project)
088: throws CoreException;
089:
090: /**
091: * Returns a VM install associated with the given classpath entry,
092: * or <code>null</code> if none.
093: *
094: * @param entry classpath entry
095: * @return vm install associated with entry or <code>null</code> if none
096: * @exception CoreException if unable to resolve a VM
097: */
098: public IVMInstall resolveVMInstall(IClasspathEntry entry)
099: throws CoreException;
100: }
|