felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Savage <dave.sav...@paremus.com>
Subject Sigil launcher
Date Thu, 20 Aug 2009 18:38:09 GMT
Hi there,

One of the usecases that was always kinda neat in the codecauldron
version of sigil was the ability install/start/stop/uninstall bundles
in a running OSGi container and still do debug from the IDE. In the
codecauldron version of sigil we achieved this via a JMX connection to
mbeans that allowed us to prod the container to perform actions on the
bundle context. But the jmx approach involved starting bundles which
actually complicated the boot - what if you wanted to actually debug
the jmx bundles...chicken and egg type problems.

As I'm working on the IDE launch configuration part of sigil at the
moment I thought now would be a good time to try to rebuild this as
it's /really/ useful. To this end I've decided to try to simplify this
even further and an OSGi launcher that uses the launching api and
opens a socket that allows a client to control it from the outside
world. The server is pretty simple, accepting a set of binary commands
- install, start, update, etc and can respond with a simple status
check to query the bundles currently installed in the framework.

The reason for making this socket based is that if it is going to run
on the boot process it should not have any dependencies on libraries
that could be loaded via bundles into the OSGi container as these
would effectively then be global classes that could not be updated. I
guess I could technically have used an xml based protocol if we wanted
to make use of the java 1.4 dom/sax stuff but this immediately set of
warning bells in my xml weary brain.

I've checked the code in on the felix trunk if you want to have a look
around etc. To start the launcher use something like the following:

java $felix-trunk/sigil/site/plugins/org.apache.felix.sigil.common.runtime.jar:$felix-trunk/framework/target/org.apache.felix.framework-1.9.0-SNAPSHOT.jar
org.apache.felix.sigil.common.runtime.Main -p 9090 -a localhost

where -p specifies the port to listen on and -a the address to bind to.

You can then programatically control the bundle using the class:


Which wraps the binary protocol in a java interface - this is what I
will use from the IDE side to control the running framework.

Just wondering what others think of this idea? Wonder if it's
something that could/should be merged with general felix launcher?



View raw message