Faceted Project Framework
Version 1.3

org.eclipse.wst.common.project.facet.core.runtime
Interface IRuntime

All Superinterfaces:
IAdaptable

public interface IRuntime
extends IAdaptable

Represents a configured instance of a runtime. A runtime instance is composed of multiple runtime components.

This interface is not intended to be implemented outside of this framework. Client code can get access to IRuntime objects by using methods on the RuntimeManager class.

Author:
Konstantin Komissarchik
See Also:
RuntimeManager.getRuntimes(), RuntimeManager.getRuntime(String), RuntimeManager.isRuntimeDefined(String), RuntimeManager.defineRuntime(String,List,Map)

Method Summary
 Set<String> getAlternateNames()
          Returns the set of other names (if any) that this runtime may be known by.
 Set<IProjectFacetVersion> getDefaultFacets(Set<IProjectFacet> fixed)
          Deprecated. use IFacetedProjectWorkingCopy.getDefaultConfiguration() instead
 String getLocalizedName()
          Returns the localized name of this runtime.
 String getName()
          Returns the name of this runtime.
 Map<String,String> getProperties()
          Returns the properties associated with this runtime component.
 String getProperty(String name)
          Returns the value of the specified property.
 List<IRuntimeComponent> getRuntimeComponents()
          Returns the runtime components that comprise this runtime.
 boolean supports(IProjectFacet f)
           
 boolean supports(IProjectFacetVersion fv)
          Determines whether this runtime supports the specified project facet.
 IStatus validate(IProgressMonitor monitor)
          Performs a number of runtime-specific checks to determine whether this runtime instance is valid or not.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

getName

String getName()
Returns the name of this runtime. The runtime name is unique within the workspace.

Returns:
the name of this runtime

getLocalizedName

String getLocalizedName()
Returns the localized name of this runtime. If not specified, this will default to the name of the runtime as returned by the getName() method.

The localized name should be used in all communications with the user while all metadata references to the runtime should use the unlocalized name. Note that there is an inherent danger in this. If a runtime is deleted or renamed, existing projects that use that runtime might become invalid. In that case the system will need to communicate that problem to the user using the unlocalized name for the runtime. Since the user is never exposed to runtime's unlocalized name, the user can have trouble understanding and correcting the problem. A similar situation can arise when a project is imported into another user's workspace.

To mitigate the above risks, the name localization feature is expected to be used sparingly and only in contexts where the runtime provider can take steps to guarantee that the above situation is not likely to occur. One scenario where name localization is acceptable is when a runtime is auto-created and the user is not given ability to delete or rename it.

Returns:
the localized name of this runtime

getAlternateNames

Set<String> getAlternateNames()
Returns the set of other names (if any) that this runtime may be known by. The localized name (if specified) will be present in the alternate names set.

Returns:
the set of alternate names for this runtime or an empty set
Since:
3.0

getRuntimeComponents

List<IRuntimeComponent> getRuntimeComponents()
Returns the runtime components that comprise this runtime. Note that the order is important since for some operations components are consoluted in order and the first one capable of performing the opeation wins.

Returns:
the runtime components that comprise this runtime

getProperties

Map<String,String> getProperties()
Returns the properties associated with this runtime component. The contents will vary dependending on how the runtime was created and what component types/versions it's comprised of.

Returns:
the properties associated with this runtime

getProperty

String getProperty(String name)
Returns the value of the specified property.

Parameters:
name - the property name
Returns:
the property value, or null

supports

boolean supports(IProjectFacetVersion fv)
Determines whether this runtime supports the specified project facet. The runtime supports a project facet if any of it's components support the project facet. The support mappings are specified using the org.eclipse.wst.common.project.facet.core.runtime extension point.

Parameters:
fv - the project facet version
Returns:
true if this runtime supports the specified facet, false otherwise

supports

boolean supports(IProjectFacet f)

getDefaultFacets

Set<IProjectFacetVersion> getDefaultFacets(Set<IProjectFacet> fixed)
                                           throws CoreException
Deprecated. use IFacetedProjectWorkingCopy.getDefaultConfiguration() instead

Returns the facets (and the versions) that should be selected by default when this runtime is selected. This information is drawn from what's specified through the org.eclipse.wst.common.project.facet.core.defaultFacets extension point. The returned list is filtered by removing facets that would conflict with the specified fixed facets. Note that the returned set will always include the fixed facets. If the default version for any fixed facet is not explicitly specified through the above extension point, the latest version will be used.

Parameters:
fixed - the fixed facets
Returns:
the default facets
Throws:
CoreException - if failed for any reason

validate

IStatus validate(IProgressMonitor monitor)
Performs a number of runtime-specific checks to determine whether this runtime instance is valid or not.

Parameters:
monitor - used for getting progress information and canceling validation
Returns:
the result of validation
Since:
3.0

Faceted Project Framework
Version 1.3

Copyright (c) 2008 BEA Systems, Inc. and others. All rights reserved.