On 10/27/09 16:15, Andrew Williams wrote:
Hi there,

I am getting to know felix a little more now and appreciating much that it has to offer. One thing that has me puzzled though is how to use the auto deployment at a particular startlevel.
And for that matter - how to iterate through the startlevels on load.

The first problem is that I would like to load a set of dependencies that make up my framework before
auto-deploying bundles that make use of these bundles.
I can make this work if I know in advance all the bundles, but I would like to make it more dynamic.
Does anyone know the right way to do this?

If you have all of your bundles in the auto-deploy directory, then the launcher will install them all first in one pass, then start them all in another pass. If your bundles are written correct to listen for service availability (or if you use something like DS or iPOJO), then this ordering should be sufficient.

If your bundles are more brittle than that and simply expect some services to be available, then you could use the felix.auto.start.<n> property to install and start a set of bundles into the <n> start level, which you would likely set to 1. The other dependent bundles could stay in the auto-deploy directory, but you'd need to configire felix.startlevel.bundle to be 2 and org.osgi.framework.startlevel.beginning to be 2.

This should get everything going correctly, I believe.

If you want something more fancy or specific than this, you will likely have to write your own launcher code.

Also, If I set org.osgi.framework.startlevel.beginning=2 I still find that the container is booted only to start level 1.
Am I expecting the wrong behaviour or somehow incorrectly starting things?

Looking at the code, it looks like it is doing the right thing. The framework should go to start level 2 if you have this set; I tested it and is appears to work for me. Just make sure you have the property spelled correctly and a proper parseable integer value.

-> richard

Any tips appreciated,
Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to