org.eclipse.wst.server.core
Interface IRuntimeType


public interface IRuntimeType

Represents a (server) runtime type from which runtime instances can be created.

The server core framework supports an open-ended set of runtime types, which are contributed via the runtimeTypes extension point in the server core plug-in. Runtime type objects carry no state (all information is read-only and is supplied by the server runtime type declaration). The global list of known runtime types is available via ServerCore.getRuntimeTypes().

This interface is not intended to be implemented by clients.

[issue: What value do runtimes add? It's main role is for setting up the Java build classpath for projects holding modules that must be Java compiled. If the notion of module is to transcend the vagaries of particular types of server, and, indeed, be published to multiple servers simultaneously, then matters of build classpath had better not be tied to the particular servers involved.]

Two runtime types are identical if and only if they have the same id.

Since:
1.0

Method Summary
 boolean canCreate()
          Returns whether this runtime type can be instantiated.
 IRuntimeWorkingCopy createRuntime(java.lang.String id, IProgressMonitor monitor)
          Creates a working copy instance of this runtime type.
 java.lang.String getDescription()
          Returns the displayable description for this runtime type.
 java.lang.String getId()
          Returns the id of this runtime type.
 IModuleType[] getModuleTypes()
          Returns an array of module types that this runtime type can support.
 java.lang.String getName()
          Returns the displayable name for this runtime type.
 java.lang.String getVendor()
          Returns the displayable vendor name for this runtime type.
 java.lang.String getVersion()
          Returns the displayable version name for this runtime type.
 

Method Detail

getId

java.lang.String getId()
Returns the id of this runtime type. Each known server runtime type has a distinct id. Ids are intended to be used internally as keys; they are not intended to be shown to end users.

Returns:
the runtime type id

getName

java.lang.String getName()
Returns the displayable name for this runtime type.

Note that this name is appropriate for the current locale.

Returns:
a displayable name for this runtime type

getDescription

java.lang.String getDescription()
Returns the displayable description for this runtime type.

Note that this description is appropriate for the current locale.

Returns:
a displayable description for this runtime type

getVendor

java.lang.String getVendor()
Returns the displayable vendor name for this runtime type. If the runtime type did not specific a vendor, an empty string is returned.

Note that this description is appropriate for the current locale.

Returns:
a displayable vendor name for this runtime type

getVersion

java.lang.String getVersion()
Returns the displayable version name for this runtime type. If the runtime type did not specific a vendor, an empty string is returned.

Note that this description is appropriate for the current locale.

Returns:
a displayable version name for this runtime type

getModuleTypes

IModuleType[] getModuleTypes()
Returns an array of module types that this runtime type can support.

A new array is returned on each call, so clients may store or modify the result.

Returns:
the array of module types IModuleType

canCreate

boolean canCreate()
Returns whether this runtime type can be instantiated.

[issue: It's unclear what this method is for. The implementation checks whether the "class" and "workingCopyClass" attributes (both optional) were specified. What would be the point of a runtime type that didn't have both of these attributes and could not be "created"?]

Returns:
true if this type of runtime can be instantiated, and false if it cannot
See Also:
createRuntime(String, IProgressMonitor)

createRuntime

IRuntimeWorkingCopy createRuntime(java.lang.String id,
                                  IProgressMonitor monitor)
                                  throws CoreException
Creates a working copy instance of this runtime type. After setting various properties of the working copy, the client should call IRuntimeWorkingCopy.save(boolean, IProgressMonitor) to bring the runtime instance into existence.

Default values are set by calling the instance's delegate. Clients should assume that the location and other properties are not set and must be explicitly set by the client.

Parameters:
id - the id to assign to the runtime instance; the default name is used if id is null or an empty string
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a new runtime working copy with the given id
Throws:
CoreException - if an exception occurs while creating this runtime or setting it's default values