Re: Launch Equinox and pass commands via wrapper application
Hi again,
i played around a little more and made some steps into the right
direction I guess:
public class FooStarter {
private FrameworkAdaptor m_adaptor;
private OSGi m_osgi;
private BundleContext m_context;
public FooStarter(String[] args) {
File test = new File("");
String path = test.getAbsolutePath();
System.setProperty("osgi.configuration.area", path+"/
configuration");
System.setProperty("osgi.install.area", path);
m_adaptor = new BaseAdaptor(args);
m_osgi = new OSGi(m_adaptor);
m_context = m_osgi.getBundleContext(); }
public void start() {
this.m_osgi.launch(); }
public static void main(String[] args) {
FooStarter starter = new FooStarter(args);
starter.start(); }
}
Status Quo:
- This lets me launch the correct framework which I see when I
System.out all m_context.getBundles().
- Passing arguments to the framework works fine, too.
Still TODO:
- But I can't collect arguments set by bundles within the framework.
Neither System.getProperty("error") nor m_context.getProperty("error")
returns a value. Both are null and I wonder why. Maybe the framework
wasn'n initialized correctly? Usually this flag gets set in my
CommandProviders bundles constructor. So it should be there at
startup.
- How do I pass command line commands to the framework (i.e. invoke a
"run" command)?