Hi Benjamin, I guess I'm mistaken, maybe I didn't express it clearly. The ID is also before the "-" dash. For example:
foo.bar-dummy1 foo.bar-dummy2 will result in two services of type foo.bar where one will be configured in the way of dummy1 where the other will be configured in the way of dummy2. Now regarding configurations and configuration files. A configuration in the feature file leads to a ConfigAdmin only configuration where the -dummy1 and -dummy2 part will be replaced by a generated ID by the ConfigurationAdmin service, this already had been this way with 2.2.x and 2.3.x, therefore this is nothing new with Karaf 3.0.x All of this is handled by the ConfigAdminService provided by the Felix project which we use since the beginning. A configuration file mentioned in the feature definition will be copied over to the etc folder and will be loaded by the FileInstall service which recognizes it as a ConfigurationAdmin service Configuration and in this special case it even identifies it as ManagedService configurations. Therefore those configurations are added to the ConfigAdminService and again it does convert the ID to a generated ID. With config:list you should see this in both Karaf 2.3.x and 3.0.x. The only difference the configuration coming from the file will also contain an "ID" (don't remember which from top of my head) telling you the name of the configuration used by the file. Example: configration: foo.bar-dummy1.cfg --> foo.bar-12345678 contains config: ID=foo.bar.dummy1 other=config This ID usually is used by the FileInstaller to write back configurations to the file in case those changed by the ConfigurationAdminService. afaik, this generated ID is defined in the OSGi spec. regards, Achim 2014-07-02 10:39 GMT+02:00 Benjamin Debeerst <[email protected] >: > Hello, > > > > This is news for me too. I’m still working with Karaf 2.3.x, and there the > Factory PID is indeed the part before the dash. This holds equally for > files as for configurations in features. > > > > So in Karaf 3 feature configurations, the part before the dash does not > play a role at all? But for configuration files in the deploy folder it > does? This seems weird/confusing to me. > > > > Regards, > > Benjamin > > > > > > > > > > > > *From:* Achim Nierbeck [mailto:[email protected]] > *Sent:* Mittwoch, 2. Juli 2014 08:52 > *To:* [email protected] > *Subject:* Re: Problems With Factory Configurations In Karaf 3.0.1 > > > > Maybe I've answered to quick ;) > > > > Yes indeed the part after the "-" is the factory pid part. > > Though, this is also a generated ID by the ConfigurationAdmin Service. > > With the config-files in etc though there is a "binding" between > > foo.bar-encrypted.cfg and foo.bar-randomID from the Configuration. > > If you do a config:list on the Karaf 2.3.x line you'll also see this kind > of pattern for ManagedServiceFactories. > > You also will notice a field that you didn't configure yourself but which > is passed along through the FileInstaller service, that one binds the > configuration back to the file. So if you update a configuration via > command or any other means of using the ConfigurationAdmin service it will > be persisted back to the config file through the FileInstaller (or used to, > but that's some time ago, so maybe it's the ConfigAdmin service now) > > > > So basically, everything is working as designed ;) > > > > regards, Achim > > > > > > > > > > 2014-07-02 7:01 GMT+02:00 Gareth <[email protected]>: > > Hello Achim, > > Thanks for the quick response! > > I am confused. I understood that if I created a file foo.bar-encrypted.cfg > in the etc directory a configuration would be created for factory pid > foo.bar. Similarly if I created a configuration like this in a feature > file: > > <config name="foo.bar-encrypted"> > . > . > </config> > > I thought a configuration for factory pid foo.bar would also be created. > Have I misunderstood something here? This is the behaviour I saw in karaf > 2.3...which doesn't seem to be the case now (at least for adding the > configuration for the feature files). Now it is thinking the part after the > "-" is the factory pid. > > thanks, > Gareth > > > > -- > View this message in context: > http://karaf.922171.n3.nabble.com/Problems-With-Factory-Configurations-In-Karaf-3-0-1-tp4033921p4033928.html > > Sent from the Karaf - User mailing list archive at Nabble.com. > > > > > > -- > > > Apache Member > > Apache Karaf <http://karaf.apache.org/> Committer & PMC > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & > Project Lead > blog <http://notizblog.nierbeck.de/> > > > > Software Architect / Project Manager / Scrum Master > > > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Software Architect / Project Manager / Scrum Master
