karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steinar Bang ...@dod.no>
Subject How's config connected to a bundle
Date Wed, 06 Dec 2017 19:43:27 GMT
How's karaf config connected to a bundle?

I tried matching on bundle name.  Ie. I have a bundle with symbolic-name
no.priv.bang.sonar.sonar-collector-webhook so I tried creating a config
with a PID identical to this, ie.
 config:edit no.priv.bang.sonar.sonar-collector-webhook
 config:property-set sonar.collector.jdbc.url "jdbc:postgresql:///sonarcollector"
 config:property-set sonar.collector.jdbc.user "karaf"

but the resulting config isn't fed to a component in the bundle.  All I
get there, is the stuff sett in the attributes.

Ie. what I received in the activate method is this:
 {alias=/sonar-collector, component.name=no.priv.bang.sonar.collector.webhook.SonarCollectorServlet,

I tried adding the pid like I found in this example:
ie. like so:
 @Component(service={Servlet.class}, property={"alias=/sonar-collector"}, configurationPid
= "no.priv.bang.sonar.sonar-collector-webhook" )
 public class SonarCollectorServlet extends HttpServlet {
    public void activate(Map<String, Object> config) {
but that didn't help.

The config can be found but show up as without a null BundleLocation:
 karaf@root()> config:list "(service.pid=no.priv.bang.sonar.sonar-collector-webhook)"
 Pid:            no.priv.bang.sonar.sonar-collector-webhook
 BundleLocation: null
    service.pid = no.priv.bang.sonar.sonar-collector-webhook
    sonar.collector.jdbc.url = jdbc:postgresql:///sonarcollector
    sonar.collector.jdbc.user = karaf

Would it have helped if my bundle had shown up in the BundleLocation?
What does it take to get a bundle there?


- Steinar

View raw message