ace-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Passchier, I. (Igor)" <igor.passch...@tno.nl>
Subject RE: deploying configuration data
Date Fri, 01 Mar 2013 21:23:36 GMT
Hello Marcel,

Thanks for your reply. Adding the auto configuration resource processor made that indeed the
configuration files are accepted and deployed. However, they now fail on non conformance of
my config file by the auto configuration resource processor. I think I have some xsd version
issue, which I will trace down. Ace seems to be doing what I need. After fixing the non conformance,
I will give Velocity a try.

Regards,

Igor Passchier


-----Original Message-----
From: Marcel Offermans [mailto:marcel.offermans@luminis.nl] 
Sent: vrijdag 1 maart 2013 18:12
To: users@ace.apache.org
Subject: Re: deploying configuration data

Hello Igor,

On Mar 1, 2013, at 17:35 , "Passchier, I. (Igor)" <igor.passchier@tno.nl> wrote:

> I am operating a set of OSGi platforms, based on apache Felix, which I would like to
manage with apache ace. Most bundles are developed by ourselves, where dependency and configuration
is automated with SCR. Currently platform management and configuration is done via Felix webconsole.
I tried to find a way to supply configuration data via apache ace, but to no avail.

ACE supports the "Auto Configuration Specification" as described in the OSGi Compendium chapter
115.

We should probably do a better job at documenting how this works though.

> In the various mailing list and source code, I found references to the xml metatype description,
but deploying these via Ace fails in the deployment stage. I also found references to the
use .cfg files containing key/value pairs, but these I cannot add on the server side ("no
artifact recognizer").

You should not use the .cfg files, unless you write a resource processor for them yourself,
but that is not the easiest way.

> How can I deploy configuration data to my osgi targets via Ace, preferably depending
on some properties of my targets?

There are a couple of things you need to do:

1) Add an artifact to ACE that implements the Auto Configuration resource processor. I suggest
you either download the latest release from [1] or build it from source (it's part of Apache
Felix) yourself. Note that when you add this artifact to ACE, it will *not* become visible
in the left most column, but it will be in the OBR. If you omit this step, things will seem
to work, but you cannot deploy configurations as at deploy time it will try to ship the resource
processor automatically along with the xml configurations.

2) Create an xml configuration that complies to the specification, and upload that as an artifact
as well. It should be visible, and you should be able to assign it to a feature and get it
on a target just like you would with bundles.

3) Now deploy. :)

To answer your final question, there is one extra feature that ACE supports for these xml
config files, and that is they can be processed using Velocity. That means you can make a
configuration file that really is a template, and in the template you can define variables
that will be replaced with values.

Now how can you provide values for these variables?

Go to a target in the UI, double click it, then go to the tag editor. Here you can enter key/value
pairs and these will be used to fill out your template. If you have a variable called "hostname"
there, you should use the following in the xml file: "${context.hostname}". So, always prefix
them with "context.".

If you want to do more fancy things, check out the Velocity website.

For more advanced use, you can also add tags to features or distributions. That is sometimes
useful if you have a configuration value for a whole group of targets.

Hope this helps. If not, let me know!

Greetings, Marcel


[1] http://felix.apache.org/downloads.cgi

This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/emaildisclaimer


Mime
View raw message