[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Configuration Admin Question
- From: Neil Bartlett <njbartlett@xxxxxxxxx>
- Date: Wed, 4 Nov 2009 13:13:12 +0000
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YxKyh2JY4nLOW1EnvlZ8PN1YmbuvXgIRBNU6omqFx5L3XHd6M0lNHgVZKo/kBHqb/O pWcFHmEhV70O+nfkY/lGdmBoHkisp2jwlgOSVyBWSwf39B4AsS18eZuu8jwuSecPYNQj So80uTjJEj3D9oSV3PrWhCUdX9xa8YjDvUjqU=
MSF.updated() is called when the client of Config Admin calls update()
on the Configuration object returned by createFactoryConfiguration().
Another point about the PID, from the MSF implementer's point of view:
you will be passed the generated PID into your updated() method, but
generally you treat it as opaque. I think that 99% of the time I
simply use it as a key into a Map. Bear in mind that updated() can be
called concurrently so you need to implement "create-or-update"
By the way, these questions are about generic OSGi usage, not about
Equinox development. If you have further questions in this vein it
would be better to ask them elsewhere, e.g. newsgroups or the #osgi
channel on IRC.
On Wed, Nov 4, 2009 at 1:09 PM, David Conde <dconde@xxxxxxxx> wrote:
> Hi Neil,
> Thank for your answer, it was very helpful for me. Just this was what I did not understand, thanks very much.
> I have another question, when is the method updated(String, Dictionary) of MSF called, is it called by event, or do I have to do it when I wish to get another instance for my second device?
> Thanks in advance
> -----Mensaje original-----
> De: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] En nombre de Neil Bartlett
> Enviado el: miÃrcoles, 04 de noviembre de 2009 13:23
> Para: Equinox development mailing list
> Asunto: Re: [equinox-dev] Configuration Admin Question
> Yes it sounds like Config Admin with a ManagedServiceFactory (MSF) may
> fit your requirements.
> I agree that Config Admin is difficult to understand -- I struggled
> with it initially as well. I think that the key to understanding MSFs
> is that you do not control the PID. You call
> createFactoryConfiguration() with the FactoryPID, and a PID is
> generated for you by the Config Admin implementation bundle. If you
> later need the PID then you have to get it from the Configuration
> object returned to you from createFactoryConfiguration().
> Hope that helps,
> On Wed, Nov 4, 2009 at 12:00 PM, David Conde <dconde@xxxxxxxx> wrote:
>> I am thinking about using Configuration Admin Service for my scenario where
>> I have to install different bundles which provide services to use different
>> devices. The problem is the next one, if I have many equal devices (just
>> with different configuration) I would have to use the same bundle which I
>> would get an DuplicateBundle_Error because I can not install again this
>> bundle, what It is normal because it would be a waste of resources. For this
>> reason I though to use Configuration Admin Service with
>> ManageServiceFactory, which lets me to use different instances of a same
>> service. I have been reading about Configuration Admin Examples and
>> Configuration Admin Service documentation in OSGI compendium but I do not
>> understand very well how exactly this service works, because I do not see
>> the relation between Factory_PID and Service PID. If I want to create new
>> instances of my services, when I create a new Configuration for example, I
>> would like to create create a new PID for my new Configuration and not to
>> call the PID_Factory, how can I create a new configuration for a new
>> instance with a new PID?
>> There are another way to manage bundles for devices different of Config
>> Admin Service?
>> Thank you in advance
>> equinox-dev mailing list
> equinox-dev mailing list
> equinox-dev mailing list