|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a runtime instance. Every runtime is an instance of a particular, fixed runtime type.
Servers have a runtime. The server runtime corresponds to the installed code base for the server. The main role played by the server runtime is in identifying code libraries to compile or build against. In the case of local servers, the server runtime may play a secondary role of being used to launch the server for testing. Having the server runtimes identified as an entity separate from the server itself facilitates sharing server runtimes between several servers.
IRuntime implements IAdaptable to allow users to obtain a runtime-type-specific class. By casting the runtime extension to the type prescribed in the API documentation for that particular runtime type, the client can access runtime-type-specific properties and methods. getAdapter() may involve plugin loading, and should not be called from popup menus, etc.
The server framework maintains a global list of all known runtime instances
(ServerCore.getRuntimes()
).
All runtimes have a unique id. Two runtimes (or more likely a runtime and it's working copy) with the same id are equal, and two runtimes with different ids are never equal.
Two runtimes are identical if and only if they have the same id.
This interface is not intended to be implemented by clients.
IRuntimeWorkingCopy
Method Summary | |
---|---|
IRuntimeWorkingCopy |
createWorkingCopy()
Returns a runtime working copy for modifying this runtime instance. |
void |
delete()
Deletes the persistent representation of this runtime. |
java.lang.Object |
getAdapter(java.lang.Class adapter)
Returns an object which is an instance of the given class associated with this object. |
java.lang.String |
getId()
Returns the id of this runtime instance. |
IPath |
getLocation()
Returns the absolute path in the local file system to the root of the runtime, typically the installation directory. |
java.lang.String |
getName()
Returns the displayable name for this runtime. |
IRuntimeType |
getRuntimeType()
Returns the type of this runtime instance. |
boolean |
isReadOnly()
Returns whether this runtime is marked read only. |
boolean |
isStub()
Returns whether this runtime is a stub (used for compilation only) or a full runtime. |
boolean |
isWorkingCopy()
Returns true if this is a working copy. |
java.lang.Object |
loadAdapter(java.lang.Class adapter,
IProgressMonitor monitor)
Returns an object which is an instance of the given class associated with this object. |
IStatus |
validate(IProgressMonitor monitor)
Validates this runtime instance. |
Method Detail |
public java.lang.String getName()
Note that this name is appropriate for the current locale.
public java.lang.String getId()
For the id of the runtime type, use IRuntimeType.getId()
public void delete() throws CoreException
CoreException
- if there was any error received while deleting the runtime
or if this method is called on a working copypublic boolean isReadOnly()
true
if this runtime is marked as read only,
and false
otherwisepublic boolean isWorkingCopy()
true
if this runtime is a working copy
(can be cast to IRuntimeWorkingCopy), and
false
otherwisepublic java.lang.Object getAdapter(java.lang.Class adapter)
null
if
no such object can be found.
This method will not check the delegate class for adapting unless it is already loaded. No plugin loading will occur when calling this method.
adapter
- the adapter class to look up
null
if this object does not
have an adapter for the given classIAdaptable#getAdapter(Class)
public java.lang.Object loadAdapter(java.lang.Class adapter, IProgressMonitor monitor)
null
if
no such object can be found.
This method will force a load of the delegate class and check it for adapting.
adapter
- the adapter class to look upmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
null
if this object does not
have an adapter for the given classpublic IRuntimeType getRuntimeType()
public IRuntimeWorkingCopy createWorkingCopy()
The runtime working copy is related to this runtime instance in the following ways:
this.getWorkingCopy().getId() == this.getId() this.getWorkingCopy().getOriginal() == this
[issue: IRuntimeWorkingCopy extends IRuntime. Runtime.getWorkingCopy() create a new working copy; RuntimeWorkingCopy.getWorkingCopy() returns this. This may be convenient in code that is ignorant of whether they are dealing with a working copy or not. However, it is hard for clients to manage working copies with this design.
public IPath getLocation()
null
if nonepublic boolean isStub()
true
if this runtime is a stub, and
false
otherwisepublic IStatus validate(IProgressMonitor monitor)
This method is not on the working copy so that the runtime can be validated at any time.
monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
IStatus.OK
if this
runtime is valid, otherwise a status object indicating what is
wrong with it
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |