Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [kura-dev] question about kura's configuration service

Hi Scott,
I’ve checked the classes and ConfigurationPlugin should be supported by Kura 2.0.2 since it uses Equinox 3.8.1 and the ConfigurationPlugin interface is available.

Also will the Kura ConfigurationService only configure _registered_ OSGi services which implement the "ConfigurableComponent" interface.

The ConfigurationService will only forward data to the ConfigurationAdmin under specific circumstances.

Scott reported that he is able to modify the configuration of the component via web ui. The ConfigurationPlugin implementation, as reported by the javadoc, should be tracked by the ConfigurationAdmin [1]. What the Kura ConfigurationService implementation does is to manage configurable components configurations and send them to the ConfigurationAdmin using the following lines:

Configuration config = m_configurationAdmin.getConfiguration(m_servicePidByPid.get(pid), null);
config.update(CollectionsUtil.mapToDictionary(mergedProperties));

Looking at the ConfigurationImpl code (sorry I was not able to find the code corresponding to the 3.8.1):

public void update(Dictionary<String, ?> properties) throws IOException {
		try {
			lock();
			checkDeleted();
			updateDictionary(properties);
			changeCount++;
			save();
			configurationAdminFactory.notifyConfigurationUpdated(this, factoryPid != null);
			configurationAdminFactory.dispatchEvent(ConfigurationEvent.CM_UPDATED, factoryPid, pid);
		} finally {
			unlock();
		}
	}

the code should perform some updates and saves and, as last operation, dispatch a ConfigurationEvent that you should be able to catch with a ConfigurationListener.
Maybe, could you share with us a mockup of your code, in order to be able together to see what is going on?

Thanks.
Best regards,
Matteo


[2] http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/tree/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java?id=521596f26e818ea7109cc8c7edba82c2a91030c1&h=R3_4_maintenance
-- 
Matteo Maiero
Software Engineer

direct: +39 0433 485 902

EUROTECH
Imagine.Build.Succeed.
HEADQUARTERS
EUROTECH S.p.A. – Via Fratelli Solari, 3/a | 33020 Amaro UD | Italy | Tel. +39. 0433 485411  | Fax +39. 0433 485499 |
Cap. Soc. 8.878.946,00 € I.V. | P.IVA / C.F.: IT 01791330309 | REA Udine 196115
www.eurotech.com
____________________________________

Il presente messaggio ed ogni suo allegato sono da intendersi inviati esclusivamente agli effettivi destinatari e potrebbero essere soggetti a restrizioni legali. Se avete ricevuto questo messaggio per errore vi invitiamo a darne immediata notifica al mittente e cancellarlo dal vostro sistema. Qualsiasi altro uso di questo messaggio da parte vostra e' strettamente proibito.
 
This e-mail, and any file attached to it, is meant only for the intended recipient of the transmission and may be a communication privileged by law. If you have received it in error, please notify the sender immediately and delete the original from your system. Any other use of this e-mail by you is strictly forbidden.

Il giorno 06 gen 2017, alle ore 20:31, Jens Reimann <jreimann@xxxxxxxxxx> ha scritto:

I am not sure of that version of Equinox supports ConfigurationPlugin. IIRC it is Equinox 3.8.

Also will the Kura ConfigurationService only configure _registered_ OSGi services which implement the "ConfigurableComponent" interface.

The ConfigurationService will only forward data to the ConfigurationAdmin under specific circumstances. So it may very well be, that you just don't get an even. Because the event is still being sent by the ConfigurationAdmin and not by the Kura ConfigurationService.

Hope this helps

Jens



On Fri, Jan 6, 2017 at 12:47 AM, Lewis, ScottX <scottx.lewis@xxxxxxxxx> wrote:
Hi Jens/all,

Another question about Kura's ConfigurationAdmin:

Using 2.0.2, I've created and registered an instance of org.osgi.service.cm.ConfigurationPlugin [1], but I'm not ever getting the call to modifyConfiguration when updating via the Kura Admin UI.   I also don't seem to be getting a ConfigurationListener event under similar circumstances.

Any insight about what is needed to have a ConfigurationPlugin be called would be helpful.

Thanks,

Scott







From: kura-dev-bounces@xxxxxxxxxxx [kura-dev-bounces@xxxxxxxxxxx] on behalf of Jens Reimann [jreimann@xxxxxxxxxx]
Sent: Tuesday, January 03, 2017 11:31 PM
To: Kura Developers mailing list
Subject: Re: [kura-dev] question about kura's configuration service

Hi Scott,



On Sat, Dec 31, 2016 at 11:33 PM, Lewis, ScottX <scottx.lewis@xxxxxxxxx> wrote:
Hi Jens,

<stuff deleted>

[Scott]  Do you expect these to be implemented via ConfigurationPlugins?

I have no expectations at the moment ;-) But if you have a good idea. let's discuss it!

[Scott]  FWIW, I do think that if possible, it would make sense to use the ConfigurationPlugin extension mechanism for ConfigurationAdmin.  We/Intel may have to create a ConfigurationPlugin ourselves that uses Metatype so I've been looking into this recently.

I don't think that all things can be achieved by the ConfigurationPlugins btw, some may be. But not all.
 

I already looked into the Equinox CM in the base, due to some bugs I encountered. It is quite .. well ... suboptimal. So I switched to Apache Felix CM. Which works great! I also heard a bit about a reference implementation for the OSGi R7 CM.

[Scott]  From where/whom?   If you have any info about that please post any links.   Also...are the R7 spec additions for CM significant?  Do you happen to know the RFP?

From a someone attending a talk at EclipseCon 2016 about that  ;-) That is why I am a bit careful about that before I dug into this myself!
 

So my plan was to look into R7 and then maybe build something based on top of that or based on Apache Felix CM. And of course look for anything else "out there" before implementing something. So if you have a good idea, now would be the best time ;-)

[Scott]  FWIW, unless there is something in R7 that just can't be lived without, I suggest using the R6 (rather than R7) spec and full impl (e.g. Felix CM).   

That was my intention as well, but maybe R7 provides more stuff which we would need. But yes, it has to be evaluated. And I agree, unless there is something really helpful, then stick with Felix. Or some other "non-Equinox" implementation. Because the Equinox implementation is not a good choice IMHO.

Cheers

Jens


 

Scott


_______________________________________________
kura-dev mailing list
kura-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kura-dev



--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill

_______________________________________________
kura-dev mailing list
kura-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kura-dev



--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill
_______________________________________________
kura-dev mailing list
kura-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kura-dev


Back to the top