|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.core.runtime.Platform
The central class of the Eclipse Platform Runtime. This class cannot be instantiated or subclassed by clients; all functionality is provided by static methods. Features include:
The platform is in one of two states, running or not running, at all
times. The only ways to start the platform running, or to shut it down,
are on the bootstrap BootLoader
class. Code in plug-ins will
only observe the platform in the running state. The platform cannot
be shutdown from inside (code in plug-ins have no access to
BootLoader
).
Field Summary | |
static int |
FAILED_DELETE_METADATA
Status code constant (value 6) indicating the platform could not delete some of its metadata. |
static int |
FAILED_READ_METADATA
Status code constant (value 4) indicating the platform could not read some of its metadata. |
static int |
FAILED_WRITE_METADATA
Status code constant (value 5) indicating the platform could not write some of its metadata. |
static int |
INTERNAL_ERROR
Status code constant (value 3) indicating an error internal to the platform has occurred. |
static String |
OPTION_STARTTIME
Debug option value denoting the time at which the platform runtime was started. |
static int |
PARSE_PROBLEM
Status code constant (value 1) indicating a problem in a plug-in manifest ( plugin.xml ) file. |
static String |
PI_RUNTIME
The unique identifier constant (value " org.eclipse.core.runtime ")
of the Core Runtime (pseudo-) plug-in. |
static int |
PLUGIN_ERROR
Status code constant (value 2) indicating an error occurred while running a plug-in. |
static String |
PT_APPLICATIONS
The simple identifier constant (value " applications ") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of runnable applications. |
Method Summary | |
static void |
addAuthorizationInfo(URL serverUrl,
String realm,
String authScheme,
Map info)
Adds the given authorization information to the keyring. |
static void |
addLogListener(ILogListener listener)
Adds the given log listener to the notification list of the platform. |
static void |
addProtectionSpace(URL resourceUrl,
String realm)
Adds the specified resource to the protection space specified by the given realm. |
static URL |
asLocalURL(URL url)
Returns a URL which is the local equivalent of the supplied URL. |
static void |
endSplash()
Takes down the splash screen if one was put up. |
static void |
flushAuthorizationInfo(URL serverUrl,
String realm,
String authScheme)
Removes the authorization information for the specified protection space and given authorization scheme. |
static IAdapterManager |
getAdapterManager()
Returns the adapter manager used for extending IAdaptable objects. |
static Map |
getAuthorizationInfo(URL serverUrl,
String realm,
String authScheme)
Returns the authorization information for the specified protection space and given authorization scheme. |
static String[] |
getCommandLineArgs()
Returns the command line args provided to the platform when it was first run. |
static String |
getDebugOption(String option)
Returns the identified option. |
static IPath |
getLocation()
Returns the location of the platform working directory. |
static IPath |
getLogFileLocation()
Returns the location of the platform log file. |
static Plugin |
getPlugin(String id)
Returns the plug-in runtime object for the identified plug-in or null if no such plug-in can be found. |
static IPluginRegistry |
getPluginRegistry()
Returns the plug-in registry for this platform. |
static IPath |
getPluginStateLocation(Plugin plugin)
Returns the location in the local file system of the plug-in state area for the given plug-in. |
static String |
getProtectionSpace(URL resourceUrl)
Returns the protection space (realm) for the specified resource, or null if the realm is unknown. |
static PluginRegistryModel |
parsePlugins(URL[] pluginPath,
Factory factory)
Returns a plug-in registry containing all of the plug-ins discovered on the given plug-in path. |
static void |
removeLogListener(ILogListener listener)
Removes the indicated (identical) log listener from the notification list of the platform. |
static URL |
resolve(URL url)
Returns a URL which is the resolved equivalent of the supplied URL. |
static void |
run(ISafeRunnable runnable)
Runs the given runnable in a protected mode. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PI_RUNTIME
org.eclipse.core.runtime
")
of the Core Runtime (pseudo-) plug-in.
public static final String PT_APPLICATIONS
applications
") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of runnable applications. A plug-in may define any
number of applications; however, the platform is only capable
of running one application at a time.
BootLoader.run(java.lang.String, java.net.URL, java.lang.String, java.lang.String[])
,
Constant Field Valuespublic static final String OPTION_STARTTIME
getDebugOption
to find the string value of
System.currentTimeMillis()
when the platform was started.
public static final int PARSE_PROBLEM
plugin.xml
) file.
public static final int PLUGIN_ERROR
public static final int INTERNAL_ERROR
public static final int FAILED_READ_METADATA
public static final int FAILED_WRITE_METADATA
public static final int FAILED_DELETE_METADATA
Method Detail |
public static void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException
Map
of String
to String
and typically
contains information such as usernames and passwords.
serverUrl
- the URL identifying the server for this authorization
information. For example, "http://www.example.com/".realm
- the subsection of the given server to which this
authorization information applies. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which this authorization information
applies. For example, "Basic" or "" for no authorization schemeinfo
- a Map
containing authorization information
such as usernames and passwords (key type : String
,
value type : String
)
CoreException
- if there are problems setting the
authorization information. Reasons include:
public static void addLogListener(ILogListener listener)
Once registered, a listener starts receiving notification as entries
are added to plug-in logs via ILog.log()
. The listener continues to
receive notifications until it is replaced or removed.
listener
- the listener to registerILog.addLogListener(org.eclipse.core.runtime.ILogListener)
,
removeLogListener(org.eclipse.core.runtime.ILogListener)
public static void addProtectionSpace(URL resourceUrl, String realm) throws CoreException
resourceUrl
- the URL identifying the resources to be added to
the specified protection space. For example,
"http://www.example.com/folder/".realm
- the name of the protection space. For example,
"realm1@example.com"
CoreException
- if there are problems setting the
authorization information. Reasons include:
public static URL asLocalURL(URL url) throws IOException
url
- original plug-in-relative URL.
IOException
- if unable to resolve URLresolve(java.net.URL)
,
IPluginDescriptor.getInstallURL()
public static void endSplash()
public static void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException
serverUrl
- the URL identifying the server to remove the
authorization information for. For example,
"http://www.example.com/".realm
- the subsection of the given server to remove the
authorization information for. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which the authorization information
to remove applies. For example, "Basic" or "" for no
authorization scheme.
CoreException
- if there are problems removing the
authorization information. Reasons include:
public static IAdapterManager getAdapterManager()
IAdaptable
objects.
IAdapterManager
public static Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme)
null
if no
such information exists.
serverUrl
- the URL identifying the server for the authorization
information. For example, "http://www.example.com/".realm
- the subsection of the given server to which the
authorization information applies. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which the authorization information
applies. For example, "Basic" or "" for no authorization scheme
null
if no
such information existspublic static String[] getCommandLineArgs()
Platform.run()
.
public static String getDebugOption(String option)
null
is returned if no such option is found. Options are specified
in the general form <plug-in id>/<option-path>.
For example, org.eclipse.core.runtime/debug
option
- the name of the option to lookup
null
public static IPath getLocation()
public static IPath getLogFileLocation()
public static Plugin getPlugin(String id)
null
if no such plug-in can be found. If
the plug-in is defined but not yet activated, the plug-in will
be activated before being returned.
id
- the unique identifier of the desired plug-in
(e.g., "com.example.acme"
).
null
public static IPluginRegistry getPluginRegistry()
IPluginRegistry
public static IPath getPluginStateLocation(Plugin plugin)
The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings.
plugin
- the plug-in whose state location is returned
public static String getProtectionSpace(URL resourceUrl)
null
if the realm is unknown.
resourceUrl
- the URL of the resource whose protection space is
returned. For example, "http://www.example.com/folder/".
null
if the realm is unknownpublic static PluginRegistryModel parsePlugins(URL[] pluginPath, Factory factory)
The given plug-in path is the list of locations in which to look for plug-ins.
If an entry identifies a directory (i.e., ends in a '/'), this method
attempts to scan all sub-directories for plug-ins. Alternatively, an
entry may identify a particular plug-in manifest (plugin.xml
) file.
Note: this method does not affect the running platform. It is intended for introspecting installed plug-ins on this and other platforms. The returned registry is not the same as the platform's registry.
pluginPath
- the list of locations in which to look for plug-insfactory
- the factory to use to create runtime model objects
public static void removeLogListener(ILogListener listener)
listener
- the listener to deregisterILog.removeLogListener(org.eclipse.core.runtime.ILogListener)
,
addLogListener(org.eclipse.core.runtime.ILogListener)
public static URL resolve(URL url) throws IOException
url
- original plug-in-relative URL.
IOException
- if unable to resolve URLasLocalURL(java.net.URL)
,
IPluginDescriptor.getInstallURL()
public static void run(ISafeRunnable runnable)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |