org.eclipse.osgi.framework.launcher
Class Launcher

java.lang.Object
  extended by org.eclipse.osgi.framework.launcher.Launcher

public class Launcher
extends java.lang.Object

This class provides an entry point for launching the OSGi framework. It configures the OSGi framework according to the command line arguments:

  • -app[lication]:application-args
        [application-args] := *( ":" [value])
        [value] := [token] | [quoted-string]
     

    This argument allows arguments to be passed to specific applications at launch time. This is for eclipse plugins installed as applications. The arguments are as Eclipse currently needs them - one list of key=value pairs which are parsed by the applications. The application peels off only the args that apply to it. Others are ignored.

  • Any other command line arguments are passed on to the console window of the framework if started with the -console option. If the console is not started, any unrecognized arguments will be ignored and a message displayed.

    If none of the options above are specified, the OSGi framework is started:

    Since:
    3.1

    Field Summary
    protected  java.lang.String[] adaptorArgs
              array of adaptor arguments to be passed to FrameworkAdaptor.initialize()
    protected  java.lang.String adaptorClassName
              string containing the classname of the adaptor to be used in this framework instance
    protected  boolean console
              flag to indicate whether or not to start the console
    protected  java.lang.String consolePort
              default console port
    protected  java.lang.String osgiConsoleClazz
               
     
    Constructor Summary
    Launcher()
              Default constructor.
     
    Method Summary
    protected  void _adaptor(java.lang.String command)
              Remembers that the -adaptor option has been requested.
    protected  void _console(java.lang.String command)
              Remembers that the -console option has been requested.
    protected  FrameworkAdaptor doAdaptor()
              Processes the -adaptor command line argument.
    protected  void doIt(java.lang.String[] args)
              Performs the actual launch based on the command line arguments
    static void main(java.lang.String[] args)
              main method for Launcher.
    static boolean matchCommand(java.lang.String command, java.lang.String input, int minLength)
               
    protected  java.lang.String[] parseArgs(java.lang.String[] args)
              Parses the command line arguments and remembers them so they can be processed later.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    consolePort

    protected java.lang.String consolePort
    default console port


    console

    protected boolean console
    flag to indicate whether or not to start the console


    adaptorClassName

    protected java.lang.String adaptorClassName
    string containing the classname of the adaptor to be used in this framework instance


    osgiConsoleClazz

    protected final java.lang.String osgiConsoleClazz
    See Also:
    Constant Field Values

    adaptorArgs

    protected java.lang.String[] adaptorArgs
    array of adaptor arguments to be passed to FrameworkAdaptor.initialize()

    Constructor Detail

    Launcher

    public Launcher()
    Default constructor. Nothing at all to do here.

    Method Detail

    main

    public static void main(java.lang.String[] args)
    main method for Launcher. This method creates an Launcher object and kicks off the actual launch of a Framework instance.

    Parameters:
    args - The command line arguments

    doIt

    protected void doIt(java.lang.String[] args)
    Performs the actual launch based on the command line arguments

    Parameters:
    args - The command line arguments

    parseArgs

    protected java.lang.String[] parseArgs(java.lang.String[] args)
    Parses the command line arguments and remembers them so they can be processed later.

    Parameters:
    args - The command line arguments
    Returns:
    String [] Any arguments that should be passed to the console

    matchCommand

    public static boolean matchCommand(java.lang.String command,
                                       java.lang.String input,
                                       int minLength)

    _console

    protected void _console(java.lang.String command)
    Remembers that the -console option has been requested.


    _adaptor

    protected void _adaptor(java.lang.String command)
    Remembers that the -adaptor option has been requested. Parses off the adaptor class file name, the adaptor file name, and the size if they are there.

    Parameters:
    command - The rest of the -adaptor parameter string that contains the class file name, and possibly the adaptor file and file size.

    doAdaptor

    protected FrameworkAdaptor doAdaptor()
                                  throws java.lang.Exception
    Processes the -adaptor command line argument. Parses the arguments to get the adaptor class name, the adaptor dir or filename, and the adaptor file size.

    Returns:
    a FrameworkAdaptor object
    Throws:
    java.lang.Exception