Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] OSGi and parameters

Currently, the only way command line parameters get passed is if the -D flag is used to set a system property. Otherwise, the concept of a command line is totally absent from OSGi.

If I understand you properly, you would have a framework service that would expose the command line with something like:

package org.eclipse.osgi;
public interface CommandLine {
	public String []getArgs();
}

That would be the OSGi style.

The other option is that you could stick with the BootLoader.getCommandLineArgs() way. and just have interested bundles import the package.

Either way, as you point out, you will need to do something implementation dependent. Although, it really isn't that big of a deal, since you will just be modifying the launching code.

ben

Pascal Rapicault wrote:

Hello,

I would like to know what is the usual way of passing parameters to "application" and/or "bundle" running in OSGi.

Basically the case I'm trying to resolve is the following:
today in eclipse: a set of parameters are passed on startup (on the command line), and those parameters are then surfaced in eclipse through the Boot plugin. This gives a uniform way for people to access parameters.

How can I give the bundles access to the command line parameters, in a nice way?

My current idea is to create a implementation depend service that would surface parameters.

Any suggestions? Any ideas? Any comments?

        PaScaL





Back to the top