Hi Cristiano,

I already used the config admin service and fileinstall from Karaf in an Eclipse RCP app it works quite well. At that time blueprint was not ready so we used spring dm then. It is a little more work than in karaf as you have to care about using all the right bundles yourself but it works. It would be interesting though if Karaf could even work in an Eclipse RCP app but I did not yet test that.

For testing I can recommend pax exam. I used it in the camel osgi integration tests. It is not ideal but I think it is the best tool at the moment.

Christian


Am 28.04.2011 21:06, schrieb Cristiano Gavião:
Hi Christian,

I researched more info and blueprint seams to be the best way to follow because we could inject beans too. I made a small test with it under Karaf and it works very well...

We are implement a server side using karaf with felix but we can't use karaf on client side because it is a RCP application. And the service we want to dynamically configure should be injected on both sides. Now my concern is that eclipse doesn't have blueprint out of box. I could see that exists two options today: Gemini and Aries. I will investigate a little more.

One question, what is the best way to implement automated test to evaluate the blueprint + configuration behavior scenarios ? are you using any tool?

cheers and thanks

Cristiano

On 26/04/11 12:01, Christian Schneider wrote:
Hi Cristiano,

I have most experience in spring dm. Currently spring is the most comprehensive solution. The problem with spring dm is that you need to import any package the your spring config defines into your bundle. This is far from ideal but it works.

I have also some experience with blueprint (Apache Aries). I think it lacks some features but for the things it supports it works great. I think you should check if blueprint already does everything you need. If yes then it is the best option.

Declarative servcies are not so usefull as they are limited to just services while blueprint and spring dm have bigger scope.

For the container I propose you look at karaf + equinox if you need equinox. It should do all karaf + felix does. The good thing with karaf in general is that it provides great features for provisioning. So you can pull features and bundles from a maven repo. If you already use maven then this could be a killer feature.

For blueprint you use the following to access the config admin service:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
           xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0";
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"; xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";
           default-activation="lazy">

<cm:property-placeholder persistent-id="yourPropertyFileName" update-strategy="reload">
<cm:default-properties>
<cm:property name="sshPort" value="8101"/>
</cm:default-properties>
</cm:property-placeholder>

</blueprint>

Then you can access properties with ${propertyName}

If you use karaf then the config admin service is provided with the help of the fileinstall service. This allows you to simply create a file "yourPropertyFileName.cfg" in the etc dir of karaf. This file is then read and made available as a config admin resource with the filename as id. Each property in the file is available in blueprint then. The example above is from the ssh module of karaf which itself uses blueprint.

Btw. Have a look at the sources of Karaf to learn more blueprint :-)

Christian


Am 26.04.2011 16:41, schrieb Cristiano Gavião:
Hi Christian,

Actually, I would like a way to dynamically setup my app service using
Configuration admin service  and able its use on both equinox or
felix/karaf.

I could see that Declarative Services is out of box on equinox while Karaf
has Blueprint out of box.

Now I'm investigating if would be better to install blueprint on equinox or
DS on karaf. Initially I'm studying the second option.

any tip is welcomed?

cheers

Cristiano




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



--
----
http://www.liquid-reality.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to