Eclipse Platform
Release 3.1

org.eclipse.core.runtime.adaptor
Class EclipseStarter

java.lang.Object
  extended byorg.eclipse.core.runtime.adaptor.EclipseStarter

public class EclipseStarter
extends Object

Special startup 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 Eclipse Runtime itself and the OSGi framework need to be loaded by special class loaders. The upshot is that a client program (such as a Java main program, a servlet) cannot reference any part of Eclipse directly. Instead, a client must use this loader class to start the platform, invoking functionality defined in plug-ins, and shutting down the platform when done.

Note that the fields on this class are not API.

Since:
3.0

Field Summary
static boolean debug
           
protected static String DEFAULT_ADAPTOR_CLASS
          string containing the classname of the adaptor to be used in this framework instance
protected static String DEFAULT_CONSOLE_CLASS
           
static String PROP_ADAPTOR
           
static String PROP_ARCH
           
static String PROP_BUNDLES
           
static String PROP_BUNDLES_STARTLEVEL
           
static String PROP_CHECK_CONFIG
           
static String PROP_CLEAN
           
static String PROP_CONSOLE
           
static String PROP_CONSOLE_CLASS
           
static String PROP_CONSOLE_LOG
           
static String PROP_DEBUG
           
static String PROP_DEV
           
static String PROP_EXITCODE
           
static String PROP_EXITDATA
           
static String PROP_EXTENSIONS
           
static String PROP_FRAMEWORK
           
static String PROP_FRAMEWORK_SHAPE
           
static String PROP_IGNOREAPP
           
static String PROP_INITIAL_STARTLEVEL
           
static String PROP_INSTALL_AREA
           
static String PROP_LOGFILE
           
static String PROP_NL
           
static String PROP_NOSHUTDOWN
           
static String PROP_OS
           
static String PROP_REFRESH_BUNDLES
           
static String PROP_SYSPATH
           
static String PROP_WS
           
 
Constructor Summary
EclipseStarter()
           
 
Method Summary
protected static org.eclipse.osgi.framework.log.FrameworkLog createFrameworkLog()
           
protected static String getSysPath()
           
static boolean isRunning()
          Returns true if the platform is already running, false otherwise.
static void main(String[] args)
          This is the main to start osgi.
static Object run(Object argument)
          Runs the applicaiton for which the platform was started.
static Object run(String[] args, Runnable endSplashHandler)
          Launches the platform and runs a single application.
static void shutdown()
          Shuts down the Platform.
static void startup(String[] args, Runnable endSplashHandler)
          Starts the platform and sets it up to run a single application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug

PROP_BUNDLES

public static final String PROP_BUNDLES
See Also:
Constant Field Values

PROP_BUNDLES_STARTLEVEL

public static final String PROP_BUNDLES_STARTLEVEL
See Also:
Constant Field Values

PROP_EXTENSIONS

public static final String PROP_EXTENSIONS
See Also:
Constant Field Values

PROP_INITIAL_STARTLEVEL

public static final String PROP_INITIAL_STARTLEVEL
See Also:
Constant Field Values

PROP_DEBUG

public static final String PROP_DEBUG
See Also:
Constant Field Values

PROP_DEV

public static final String PROP_DEV
See Also:
Constant Field Values

PROP_CLEAN

public static final String PROP_CLEAN
See Also:
Constant Field Values

PROP_CONSOLE

public static final String PROP_CONSOLE
See Also:
Constant Field Values

PROP_CONSOLE_CLASS

public static final String PROP_CONSOLE_CLASS
See Also:
Constant Field Values

PROP_CHECK_CONFIG

public static final String PROP_CHECK_CONFIG
See Also:
Constant Field Values

PROP_OS

public static final String PROP_OS
See Also:
Constant Field Values

PROP_WS

public static final String PROP_WS
See Also:
Constant Field Values

PROP_NL

public static final String PROP_NL
See Also:
Constant Field Values

PROP_ARCH

public static final String PROP_ARCH
See Also:
Constant Field Values

PROP_ADAPTOR

public static final String PROP_ADAPTOR
See Also:
Constant Field Values

PROP_SYSPATH

public static final String PROP_SYSPATH
See Also:
Constant Field Values

PROP_LOGFILE

public static final String PROP_LOGFILE
See Also:
Constant Field Values

PROP_FRAMEWORK

public static final String PROP_FRAMEWORK
See Also:
Constant Field Values

PROP_INSTALL_AREA

public static final String PROP_INSTALL_AREA
See Also:
Constant Field Values

PROP_FRAMEWORK_SHAPE

public static final String PROP_FRAMEWORK_SHAPE
See Also:
Constant Field Values

PROP_NOSHUTDOWN

public static final String PROP_NOSHUTDOWN
See Also:
Constant Field Values

PROP_EXITCODE

public static final String PROP_EXITCODE
See Also:
Constant Field Values

PROP_EXITDATA

public static final String PROP_EXITDATA
See Also:
Constant Field Values

PROP_CONSOLE_LOG

public static final String PROP_CONSOLE_LOG
See Also:
Constant Field Values

PROP_IGNOREAPP

public static final String PROP_IGNOREAPP
See Also:
Constant Field Values

PROP_REFRESH_BUNDLES

public static final String PROP_REFRESH_BUNDLES
See Also:
Constant Field Values

DEFAULT_ADAPTOR_CLASS

protected static final String DEFAULT_ADAPTOR_CLASS
string containing the classname of the adaptor to be used in this framework instance

See Also:
Constant Field Values

DEFAULT_CONSOLE_CLASS

protected static final String DEFAULT_CONSOLE_CLASS
See Also:
Constant Field Values
Constructor Detail

EclipseStarter

public EclipseStarter()
Method Detail

main

public static void main(String[] args)
                 throws Exception
This is the main to start osgi. It only works when the framework is being jared as a single jar

Throws:
Exception

run

public static Object run(String[] args,
                         Runnable endSplashHandler)
                  throws Exception
Launches the platform and runs a single application. The application is either identified in the given arguments (e.g., -application <app id>) or in the eclipse.application System property. This convenience method starts up the platform, runs the indicated application, and then shuts down the platform. The platform must not be running already.

Parameters:
args - the command line-style arguments used to configure the platform
endSplashHandler - the block of code to run to tear down the splash screen or null if no tear down is required
Returns:
the result of running the application
Throws:
Exception - if anything goes wrong

isRunning

public static boolean isRunning()
Returns true if the platform is already running, false otherwise.

Returns:
whether or not the platform is already running

createFrameworkLog

protected static org.eclipse.osgi.framework.log.FrameworkLog createFrameworkLog()

startup

public static void startup(String[] args,
                           Runnable endSplashHandler)
                    throws Exception
Starts the platform and sets it up to run a single application. The application is either identified in the given arguments (e.g., -application <app id>) or in the eclipse.application System property. The platform must not be running already.

The given runnable (if not null) is used to tear down the splash screen if required.

Parameters:
args - the arguments passed to the application
Throws:
Exception - if anything goes wrong

run

public static Object run(Object argument)
                  throws Exception
Runs the applicaiton for which the platform was started. The platform must be running.

The given argument is passed to the application being run. If it is null then the command line arguments used in starting the platform, and not consumed by the platform code, are passed to the application as a String[].

Parameters:
argument - the argument passed to the application. May be null
Returns:
the result of running the application
Throws:
Exception - if anything goes wrong

shutdown

public static void shutdown()
                     throws Exception
Shuts down the Platform. 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). If relaunching, care must be taken to reinitialize any System properties which the platform uses (e.g., osgi.instance.area) as some policies in the platform do not allow resetting of such properties on subsequent runs.

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 anything goes wrong

getSysPath

protected static String getSysPath()

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.