On 10/30/09 14:18, Craig Phillips wrote:
Hi,
I'm posting to the group, sort of as a way of cheating... I printed out the 17 pages on
embedding felix for release 2.0.1 and I'm sort of trying to empty my head and to in to it
as if "cold"; I tried playing around with my existing 1.x launcher and sort of
tweak a few lines, but that went no where (AFAICT), and started to get a little
frustrated... So, in a cheat way, was wondering if someone out there could maybe take a
look at my 1.x snippet and reply back with an equivalent 2.x snippet.. To no avail, my
1.x snippet:
----------------------------------------------------------------------
import org.apache.felix.main.Main;
import org.apache.felix.framework.Felix;
import org.apache.felix.main.AutoActivator; // now defunct
Felix felix = null
System.getProperties().setProperty(Main.CONFIG_PROPERTIES_PROP,
"file:conf/config.properties");
Main.loadSystemProperties();
Properties configProps = Main.loadConfigProperties();
List<AutoActivator> list = new ArrayList<AutoActivator>();
list.add(new AutoActivator(configProps));
Map map = new StringMap(configProps, false);
felix = new Felix(map, list);
felix.start();
------------------------------------------------------
If someone out there can do a translation, I'd be much appreciative...
Yeah, this stuff changed a lot to be compliant with the new R4.2
embedding API. I think it should be sufficient to do:
System.getProperties().setProperty(
Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
Main.loadSystemProperties();
Properties configProps = Main.loadConfigProperties();
Main.copySystemProperties(configProps);
Felix felix = new Felix(configProps);
felix.init();
AutoProcessor.process(configProps, felix.getBundleContext());
felix.start();
felix.waitForStop(0);
System.exit(0);
-> richard
Thanks, Craig Phillips, Praxis Engineering, Inc.