Eclipse Platform
2.0

org.eclipse.core.boot
Class BootLoader

java.lang.Object
  |
  +--org.eclipse.core.boot.BootLoader

public final class BootLoader
extends Object

Special boot loader class for the Eclipse Platform. This class cannot be instantiated; all functionality is provided by static methods.

The Eclipse Platform makes heavy use of Java class loaders for loading plug-ins. Even the Platform Core Runtime itself, including the Platform class, needs to be loaded by a special class loader. The upshot is that a client program (such as a Java main program, a servlet) cannot directly reference even the Platform class. Instead, a client must use this loader class for initializing the platform, invoking functionality defined in plug-ins, and shutting down the platform when done.

See Also:
Platform

Field Summary
static String ARCH_PA_RISC
          Constant string (value "PA_RISC") indicating the platform is running on an PA_RISC-based architecture.
static String ARCH_PPC
          Constant string (value "ppc") indicating the platform is running on an PowerPC-based architecture.
static String ARCH_SPARC
          Constant string (value "sparc") indicating the platform is running on an Sparc-based architecture.
static String ARCH_X86
          Constant string (value "x86") indicating the platform is running on an x86-based architecture.
static String OS_AIX
          Constant string (value "aix") indicating the platform is running on an AIX-based operating system.
static String OS_HPUX
          Constant string (value "hpux") indicating the platform is running on an HP/UX-based operating system.
static String OS_LINUX
          Constant string (value "linux") indicating the platform is running on a Linux-based operating system.
static String OS_MACOSX
          Constant string (value "macosx") indicating the platform is running on a Mac OS X operating system.
static String OS_QNX
          Constant string (value "qnx") indicating the platform is running on a QNX-based operating system.
static String OS_SOLARIS
          Constant string (value "solaris") indicating the platform is running on a Solaris-based operating system.
static String OS_UNKNOWN
          Constant string (value "unknown") indicating the platform is running on a machine running an unknown operating system.
static String OS_WIN32
          Constant string (value "win32") indicating the platform is running on a Window 32-bit operating system (e.g., Windows 98, NT, 2000).
static String PI_BOOT
          The unique identifier constant (value "org.eclipse.core.boot") of the Core Boot (pseudo-) plug-in.
static String WS_CARBON
          Constant string (value "carbon") indicating the platform is running on a machine using the Carbon windowing system (Mac OS X).
static String WS_GTK
          Constant string (value "gtk") indicating the platform is running on a machine using the GTK windowing system.
static String WS_MOTIF
          Constant string (value "motif") indicating the platform is running on a machine using the Motif windowing system.
static String WS_PHOTON
          Constant string (value "photon") indicating the platform is running on a machine using the Photon windowing system.
static String WS_UNKNOWN
          Constant string (value "unknown") indicating the platform is running on a machine running an unknown windowing system.
static String WS_WIN32
          Constant string (value "win32") indicating the platform is running on a machine using the Windows windowing system.
 
Method Summary
static boolean containsSavedPlatform(String location)
          Returns whether the given location (typically a directory in the local file system) contains the saved data for a platform.
static String[] getCommandLineArgs()
          Returns the command line args provided to the platform when it was first run.
static IPlatformConfiguration getCurrentPlatformConfiguration()
          Returns the current platform configuration.
static URL getInstallURL()
          Returns URL at which the Platform runtime executables and libraries are installed.
static String getNL()
          Returns the string name of the current locale for use in finding files whose path starts with $nl$.
static String getOS()
          Returns the string name of the current operating system for use in finding files whose path starts with $os$.
static String getOSArch()
          Returns the string name of the current system architecture.
static IPlatformConfiguration getPlatformConfiguration(URL url)
          Returns a platform configuration object, optionally initialized with previously saved configuration information.
static URL[] getPluginPath(URL pluginPathLocation)
          Returns the complete plugin path defined by the file at the given location.
static IPlatformRunnable getRunnable(String applicationName)
          Instantiates and returns an instance of the named application's runnable entry point.
static IPlatformRunnable getRunnable(String pluginId, String className, Object args)
          Instantiates and returns an instance of the named class.
static String getWS()
          Returns the string name of the current window system for use in finding files whose path starts with $ws$.
static boolean inDebugMode()
          Returns true if the platform is currently running in debug mode.
static boolean inDevelopmentMode()
          Returns true if the platform is currently running in development mode.
static boolean isRunning()
          Returns whether the platform is running.
static String[] knownOSArchValues()
          Returns a list of known system architectures.
static String[] knownOSValues()
          Returns a list of known operating system names.
static String[] knownWSValues()
          Returns a list of known windowing system names.
static Object run(String applicationName, URL pluginPathLocation, String location, String[] args)
          Launches the Platform to run a single application.
static Object run(String applicationName, URL pluginPathLocation, String location, String[] args, Runnable handler)
          Launches the Platform to run a single application.
static void shutdown()
          Shuts down the Platform.
static String[] startup(URL pluginPathLocation, String location, String[] args)
          Launches the Eclipse Platform.
static String[] startup(URL pluginPathLocation, String location, String[] args, Runnable handler)
          Launches the Eclipse Platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PI_BOOT

public static final String PI_BOOT
The unique identifier constant (value "org.eclipse.core.boot") of the Core Boot (pseudo-) plug-in.

See Also:
Constant Field Values

OS_WIN32

public static final String OS_WIN32
Constant string (value "win32") indicating the platform is running on a Window 32-bit operating system (e.g., Windows 98, NT, 2000).

See Also:
Constant Field Values

OS_LINUX

public static final String OS_LINUX
Constant string (value "linux") indicating the platform is running on a Linux-based operating system.

See Also:
Constant Field Values

OS_AIX

public static final String OS_AIX
Constant string (value "aix") indicating the platform is running on an AIX-based operating system.

See Also:
Constant Field Values

OS_SOLARIS

public static final String OS_SOLARIS
Constant string (value "solaris") indicating the platform is running on a Solaris-based operating system.

See Also:
Constant Field Values

OS_HPUX

public static final String OS_HPUX
Constant string (value "hpux") indicating the platform is running on an HP/UX-based operating system.

See Also:
Constant Field Values

OS_QNX

public static final String OS_QNX
Constant string (value "qnx") indicating the platform is running on a QNX-based operating system.

See Also:
Constant Field Values

OS_MACOSX

public static final String OS_MACOSX
Constant string (value "macosx") indicating the platform is running on a Mac OS X operating system.

Since:
2.0
See Also:
Constant Field Values

OS_UNKNOWN

public static final String OS_UNKNOWN
Constant string (value "unknown") indicating the platform is running on a machine running an unknown operating system.

See Also:
Constant Field Values

ARCH_X86

public static final String ARCH_X86
Constant string (value "x86") indicating the platform is running on an x86-based architecture.

See Also:
Constant Field Values

ARCH_PA_RISC

public static final String ARCH_PA_RISC
Constant string (value "PA_RISC") indicating the platform is running on an PA_RISC-based architecture.

See Also:
Constant Field Values

ARCH_PPC

public static final String ARCH_PPC
Constant string (value "ppc") indicating the platform is running on an PowerPC-based architecture.

Since:
2.0
See Also:
Constant Field Values

ARCH_SPARC

public static final String ARCH_SPARC
Constant string (value "sparc") indicating the platform is running on an Sparc-based architecture.

Since:
2.0
See Also:
Constant Field Values

WS_WIN32

public static final String WS_WIN32
Constant string (value "win32") indicating the platform is running on a machine using the Windows windowing system.

See Also:
Constant Field Values

WS_MOTIF

public static final String WS_MOTIF
Constant string (value "motif") indicating the platform is running on a machine using the Motif windowing system.

See Also:
Constant Field Values

WS_GTK

public static final String WS_GTK
Constant string (value "gtk") indicating the platform is running on a machine using the GTK windowing system.

See Also:
Constant Field Values

WS_PHOTON

public static final String WS_PHOTON
Constant string (value "photon") indicating the platform is running on a machine using the Photon windowing system.

See Also:
Constant Field Values

WS_CARBON

public static final String WS_CARBON
Constant string (value "carbon") indicating the platform is running on a machine using the Carbon windowing system (Mac OS X).

Since:
2.0
See Also:
Constant Field Values

WS_UNKNOWN

public static final String WS_UNKNOWN
Constant string (value "unknown") indicating the platform is running on a machine running an unknown windowing system.

See Also:
Constant Field Values
Method Detail

containsSavedPlatform

public static boolean containsSavedPlatform(String location)
Returns whether the given location (typically a directory in the local file system) contains the saved data for a platform. The saved data for the platform is recognizable by the presence of a special platform metadata subdirectory; however, this metadata directory is not usually created unless there is some reason to do so (for example, so that an active plug-in can save its state).

Returns:
true if the location contains the saved data for a platform, and false otherwise

getCommandLineArgs

public static String[] getCommandLineArgs()
Returns the command line args provided to the platform when it was first run. Note that individual platform runnables may be provided with different arguments if they are being run individually rather than with Platform.run().

Returns:
the command line used to start the platform

getCurrentPlatformConfiguration

public static IPlatformConfiguration getCurrentPlatformConfiguration()
Returns the current platform configuration.

Returns:
platform configuration used in current instance of platform
Since:
2.0

getInstallURL

public static URL getInstallURL()
Returns URL at which the Platform runtime executables and libraries are installed. The returned value is distinct from the location of any given platform's data.

Returns:
the URL indicating where the platform runtime is installed.

getNL

public static String getNL()
Returns the string name of the current locale for use in finding files whose path starts with $nl$. null is returned if the locale cannot be determined.

Returns:
the string name of the current locale or null

getOS

public static String getOS()
Returns the string name of the current operating system for use in finding files whose path starts with $os$. OS_UNKNOWN is returned if the operating system cannot be determined. The value may indicate one of the operating systems known to the platform (as specified in knownOSValues) or a user-defined string if the operating system name is specified on the command line.

Returns:
the string name of the current operating system
See Also:
knownOSValues()

getOSArch

public static String getOSArch()
Returns the string name of the current system architecture. The value is a user-defined string if the architecture is specified on the command line, otherwise it is the value returned by java.lang.System.getProperty("os.arch").

Returns:
the string name of the current system architecture
Since:
2.0

getPlatformConfiguration

public static IPlatformConfiguration getPlatformConfiguration(URL url)
                                                       throws IOException
Returns a platform configuration object, optionally initialized with previously saved configuration information.

Parameters:
url - location of previously save configuration information. If null is specified, an empty configuration object is returned
Returns:
platform configuration used in current instance of platform
IOException
Since:
2.0

getPluginPath

public static URL[] getPluginPath(URL pluginPathLocation)
Returns the complete plugin path defined by the file at the given location. If the given location is null or does not indicate a valid plug-in path definition file, null is returned.

Returns:
the complete set of URLs which locate plug-ins

getRunnable

public static IPlatformRunnable getRunnable(String applicationName)
                                     throws Exception
Instantiates and returns an instance of the named application's runnable entry point. null is returned if the runnable cannot be found.

Parameters:
applicationName - the fully qualified name of an extension installed in the platform's applications extension point (i.e., org.eclipse.core.applications).
Returns:
a platform runnable
Throws:
Exception - if there is a problem instantiating the specified runnable

getRunnable

public static IPlatformRunnable getRunnable(String pluginId,
                                            String className,
                                            Object args)
                                     throws Exception
Instantiates and returns an instance of the named class. The class must implement IPlatformRunnable. If the class implements IExecutableExtension, the created instance is initialized with the given arguments. null is returned if the runnable cannot be found.

Parameters:
pluginId - the unique identifier of the plug-in containing the given class
className - the fully qualified name of the class to instantiate
args - the initialization arguments passed to the new instance
Returns:
a platform runnable, or null if the runnable cannot be found
Throws:
Exception - if there is a problem instantiating the specified runnable

getWS

public static String getWS()
Returns the string name of the current window system for use in finding files whose path starts with $ws$. null is returned if the window system cannot be determined.

Returns:
the string name of the current window system or null

knownOSArchValues

public static String[] knownOSArchValues()
Returns a list of known system architectures.

Note that this list is not authoritative; there may be legal values not included in this list. Indeed, the value returned by getOSArch may not be in this list. Also, this list may change over time as Eclipse comes to run on more operating environments.

Returns:
the list of system architectures known to the system
Since:
2.0
See Also:
getOSArch()

knownOSValues

public static String[] knownOSValues()
Returns a list of known operating system names.

Note that this list is not authoritative; there may be legal values not included in this list. Indeed, the value returned by getOS may not be in this list. Also, this list may change over time as Eclipse comes to run on more operating environments.

Returns:
the list of operating systems known to the system
Since:
2.0
See Also:
getOS()

knownWSValues

public static String[] knownWSValues()
Returns a list of known windowing system names.

Note that this list is not authoritative; there may be legal values not included in this list. Indeed, the value returned by getWS may not be in this list. Also, this list may change over time as Eclipse comes to run on more operating environments.

Returns:
the list of window systems known to the system
Since:
2.0
See Also:
getWS()

inDebugMode

public static boolean inDebugMode()
Returns true if the platform is currently running in debug mode. The platform is run in debug mode using the "-debug" command line argument.

Returns:
whether or not the platform is running in debug mode

inDevelopmentMode

public static boolean inDevelopmentMode()
Returns true if the platform is currently running in development mode. That is, if special procedures are to be taken when defining plug-in class paths. The platform is run in development mode using the "-dev" command line argument.

Returns:
whether or not the platform is running in development mode

isRunning

public static boolean isRunning()
Returns whether the platform is running. The startup method starts the platform running; the shutdown method stops it.

Returns:
true if the platform is running, and false otherwise
See Also:
startup(java.net.URL, java.lang.String, java.lang.String[]), shutdown()

run

public static Object run(String applicationName,
                         URL pluginPathLocation,
                         String location,
                         String[] args)
                  throws Exception
Launches the Platform to run a single application. This convenince method starts up the Platform, runs the indicated application, and then shuts down the Platform. The Platform must not be running already.

Parameters:
applicationName - The fully qualified name of an extension installed in the Platform plug-in's applications extension-point (i.e., org.eclipse.core.runtime.applications).
pluginPathLocation - the URL of the plug-in path; this is where the Platform is to find the code for plug-ins
location - the location (usually a string path in the local file file system) for the saved platform state
args - the array of command-line style argments which are passed to the Platform on initialization. The arguments which are consumed by the Platform's initialization are removed from the arg list. This modified arg list is the return value of this method.
Returns:
the list of args which were supplied but not consumed by this method.
Throws:
Exception - if anything goes wrong
See Also:
startup(java.net.URL, java.lang.String, java.lang.String[])

run

public static Object run(String applicationName,
                         URL pluginPathLocation,
                         String location,
                         String[] args,
                         Runnable handler)
                  throws Exception
Launches the Platform to run a single application. This convenince method starts up the Platform, runs the indicated application, and then shuts down the Platform. The Platform must not be running already.

Parameters:
applicationName - The fully qualified name of an extension installed in the Platform plug-in's applications extension-point (i.e., org.eclipse.core.runtime.applications).
pluginPathLocation - the URL of the plug-in path; this is where the Platform is to find the code for plug-ins
location - the location (usually a string path in the local file file system) for the saved platform state
args - the array of command-line style argments which are passed to the Platform on initialization. The arguments which are consumed by the Platform's initialization are removed from the arg list. This modified arg list is the return value of this method.
handler - an optional handler invoked by the launched application at the point the application considers itself initialized. A typical use for the handler would be to take down any splash screen that was displayed by the caller of this method.
Returns:
the list of args which were supplied but not consumed by this method.
Throws:
Exception - if anything goes wrong
See Also:
startup(java.net.URL, java.lang.String, java.lang.String[])

shutdown

public static void shutdown()
                     throws Exception
Shuts down the Platform. The Platform must be running. In the process, each active plug-in is told to shutdown via Plugin.shutdown.

Note that the state of the Platform is not automatically saved before shutting down.

On return, the Platform will no longer be running (but could be re-launched with another call to startup). Any objects handed out by running Platform, including Platform runnables obtained via getRunnable, will be permanently invalid. The effects of attempting to invoke methods on invalid objects is undefined.

Throws:
Exception - if there were problems shutting down

startup

public static String[] startup(URL pluginPathLocation,
                               String location,
                               String[] args)
                        throws Exception
Launches the Eclipse Platform. The Platform must not be running.

The location of the started Platform is defined as follows:

The plug-in path of the started Platform is defined as follows:

Parameters:
pluginPathLocation - the URL of the plug-in path; this is where the Platform is to find the code for plug-ins
location - the location (usually a string path in the local file file system) for the saved Platform state
args - the array of command-line style argments which are passed to the platform on initialization. The arguments which are consumed by the Platform's initialization are removed from the arg list. This modified arg list is the return value of this method.
Returns:
the list of args which were supplied but not consumed by this method.
Throws:
Exception - if there are problems starting the platform

startup

public static String[] startup(URL pluginPathLocation,
                               String location,
                               String[] args,
                               Runnable handler)
                        throws Exception
Launches the Eclipse Platform. The Platform must not be running.

The location of the started Platform is defined as follows:

The plug-in path of the started Platform is defined as follows:

Parameters:
pluginPathLocation - the URL of the plug-in path; this is where the Platform is to find the code for plug-ins
location - the location (usually a string path in the local file file system) for the saved Platform state
args - the array of command-line style argments which are passed to the platform on initialization. The arguments which are consumed by the Platform's initialization are removed from the arg list. This modified arg list is the return value of this method.
handler - an optional handler invoked by the launched application at the point the application considers itself initialized. A typical use for the handler would be to take down any splash screen that was displayed by the caller of this method.
Returns:
the list of args which were supplied but not consumed by this method.
Throws:
Exception - if there are problems starting the platform

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.