[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [equinox-dev] Configuration Admin Question
|
David,
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"
semantics atomically.
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.
Regards,
Neil
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
>
> Regards
>
> David
>
> -----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
>
> David,
>
> 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,
> Neil
>
>
>
> On Wed, Nov 4, 2009 at 12:00 PM, David Conde <dconde@xxxxxxxx> wrote:
>> Hi,
>>
>>
>>
>> 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@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>>
>>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>