|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.launcher.Launcher
public class Launcher
This class provides an entry point for launching the OSGi framework. It configures the OSGi framework according to the command line arguments:
[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:
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:
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 |
---|
protected java.lang.String consolePort
protected boolean console
protected java.lang.String adaptorClassName
protected final java.lang.String osgiConsoleClazz
protected java.lang.String[] adaptorArgs
Constructor Detail |
---|
public Launcher()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- The command line argumentsprotected void doIt(java.lang.String[] args)
args
- The command line argumentsprotected java.lang.String[] parseArgs(java.lang.String[] args)
args
- The command line arguments
public static boolean matchCommand(java.lang.String command, java.lang.String input, int minLength)
protected void _console(java.lang.String command)
protected void _adaptor(java.lang.String command)
command
- The rest of the -adaptor parameter string that contains the class file name,
and possibly the adaptor file and file size.protected FrameworkAdaptor doAdaptor() throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |