Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [osgi-users] Retrieving/Tracking all instances of Prototype service

Because I missed the point :)

Here there is a configuration change, but not to the component but to the global application configuration that is managed with ConfigAdmin.

Hence why I was adding a ChangeListener to pick up the events.

Alain


On Fri, Oct 1, 2021 at 10:23 AM Dirk Fauth via osgi-users <osgi-users@xxxxxxxxxxx> wrote:
Why are you talking about the ConfigurationEvent if the suggestion is to add a modified/updated method to your service? I don't get the connection in that discussion. 

Alain Picard <picard@xxxxxxxxxxxxxx> schrieb am Fr., 1. Okt. 2021, 16:12:
Thomas,

It is indeed a very good assumption, but....2 things.

1st is a bit of a hassle/performance issue where since the ConfigurationEvent doesn't tell you want changed, it needs to be tested for the value(s) you are interested in. But that is not a major issue.

2nd is that it seems (maybe I was still asleep very early this AM) but I have a service that has 2 implementations, with a ranking and it seems that adding  ConfigurationListener to the list of services for the component stopped picking up the highest ranked version when available.

So given those 2 things, I thought it would be best to manage it all under one roof. But as BJ is saying that it is not possible unless you manage the factory, which I don't care to do here if I can avoid it, I will need to recheck my 2nd issue and if not, reread the configuration value(s) instead of relying on the event.

Thanks everyone for the input.

Alain


On Fri, Oct 1, 2021 at 8:53 AM Thomas Watson <tjwatson@xxxxxxxxxx> wrote:
I assume your component configuration is coming from config admin.  If so you would specify a modified method for the service component (regardless of prototype or not) to receive the updated configuration.  See https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-modification

Tom
 
 
 
----- Original message -----
From: "Alain Picard" <picard@xxxxxxxxxxxxxx>
Sent by: "osgi-users" <osgi-users-bounces@xxxxxxxxxxx>
To: "This is a community mail list for OSGi technology. Any OSGi technical discussion or questions are acceptable here." <osgi-users@xxxxxxxxxxx>
Cc:
Subject: [EXTERNAL] [osgi-users] Retrieving/Tracking all instances of Prototype service
Date: Fri, Oct 1, 2021 6:14 AM
 
Hi,
 
I'm looking for a way to either register all instances of a prototype service or to retrieve them when needed. Here I need to call those active service instances with some change configuration.
 
In many cases, we have factories that manage the instance pool when this is required, but here I just need to get the instances and provide them with updated configuration.
 
Thanks
Alain
_______________________________________________
osgi-users mailing list
osgi-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/osgi-users
 


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

Back to the top