|
|||||||||
| Home >> All >> org >> eclipse >> osgi >> framework >> [ launcher overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.osgi.framework.launcher
Class Launcher

java.lang.Objectorg.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:
- -con[sole][:port]
Starts the OSGi framework with a console window. Any command line arguments not recognized are passed to the console for it to execute. If a port is specified the console will listen on that port for commands. If no port is specified, the console will use System.in and System.out. - -adaptor[:adaptor-name][adaptor-args]
[adaptor-name] := "" | fully qualified class name of the FrameworkAdapter [adaptor-args] := *( ":" [value]) [value] := [token] | [quoted-string] This allows -adaptor::"bundledir=c:\jarbundles":reset DefaultAdaptor is chosen with args[] {"bundledir=c:\jarbundles", "reset"} -adaptor:com.foo.MyAdaptor com.foo.MyAdaptor chosen with args[] {}-adaptor specifies the implementation class for the FrameworkAdapter to be used. args contains a list of FrameworkAdaptor arguments, separated by ":". FrameworkAdaptor arguments format is defined by the adaptor implementation class. They are passed to the adaptor class as an array of Strings. Example arguments used by the DefaultAdaptor are:
- "bundledir=directory". The directory to be used by the adaptor to store data.
- reset. Perform the reset action to clear the bundledir.
Actions can be defined by an adaptor. Multiple actions can be specified, separated by ":".
It is up to the adaptor implementation to define reasonable defaults if it's required arguments are not specified.
If -adaptor is not specified, or if no adaptor classname is specified, DefaultAdaptor will be used, which is file based and stores the files in the \bundles directory relative to the current directory.
[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:
- with the Default FrameworkAdaptor
- without a console window
- without the remote agent
| 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 |
private static java.lang.String |
OSGI_CONSOLE_COMPONENT
|
private static java.lang.String |
OSGI_CONSOLE_COMPONENT_NAME
|
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 org.eclipse.osgi.framework.adaptor.FrameworkAdaptor |
doAdaptor()
Processes the -adaptor command line argument. |
protected void |
doConsole(org.eclipse.osgi.framework.internal.core.OSGi osgi,
java.lang.String[] consoleArgs)
Invokes the OSGi Console on another thread |
protected void |
doIt(java.lang.String[] args)
Performs the actual launch based on the command line arguments |
protected org.eclipse.osgi.framework.internal.core.OSGi |
doOSGi(org.eclipse.osgi.framework.adaptor.FrameworkAdaptor adaptor)
Creates the OSGi framework object. |
(package private) void |
informAboutMissingComponent(java.lang.String component,
java.lang.String jar)
Informs the user about a missing component. |
static void |
main(java.lang.String[] args)
main method for Launcher. |
static boolean |
matchCommand(java.lang.String command,
java.lang.String input,
int minLength)
|
private 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()
OSGI_CONSOLE_COMPONENT_NAME
private static final java.lang.String OSGI_CONSOLE_COMPONENT_NAME
- See Also:
- Constant Field Values
OSGI_CONSOLE_COMPONENT
private static final java.lang.String OSGI_CONSOLE_COMPONENT
- See Also:
- Constant Field Values
| 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.
doIt
protected void doIt(java.lang.String[] args)
- Performs the actual launch based on the command line arguments
parseArgs
private java.lang.String[] parseArgs(java.lang.String[] args)
- Parses the command line arguments and remembers them so they can be processed later.
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.
doAdaptor
protected org.eclipse.osgi.framework.adaptor.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.
doOSGi
protected org.eclipse.osgi.framework.internal.core.OSGi doOSGi(org.eclipse.osgi.framework.adaptor.FrameworkAdaptor adaptor)
- Creates the OSGi framework object.
doConsole
protected void doConsole(org.eclipse.osgi.framework.internal.core.OSGi osgi, java.lang.String[] consoleArgs)
- Invokes the OSGi Console on another thread
informAboutMissingComponent
void informAboutMissingComponent(java.lang.String component, java.lang.String jar)
- Informs the user about a missing component.
|
|||||||||
| Home >> All >> org >> eclipse >> osgi >> framework >> [ launcher overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.eclipse.osgi.framework.launcher.Launcher