Humm, interesting...  thanks Carsten for correct me...


Certainly I will need to upgrade my knowledge on DS and CM again :-D

I really thought that in order to use a Factory PID such as "my.fpid~somepid" I would need a factory component.


On 06/08/2018 12:20, Carsten Ziegeler wrote:
I think the current @Component annotation is correct :) (sorry)

If you use factory="..." you will create a component factory as defined
in the DS specification - that's in contrast to a component managed by
factory configurations (which this example is about).

If you managed to get the Map of properties (which should work with the
Map.Entry change I posted recently), then the full PID of the
configuration is stored in a property named "service.pid" - you can then
search for the tilde in there and get what you want.

Regards

Carsten


Cristiano Gavião wrote

On 06/08/2018 11:10, Philipp Höfler wrote:
Sorry, pid is probably the wrong word for that. Alias might be more
correct.
I am talking about the name after the ~ in the configuration file
(my.config~system1).
In this case I would like to get "system1".
Ah, now I understood.

I think you won't get that since your component is not a factory.  If
I'm remember right, you need to use a FPID (factory pid), so your
component must be declared this way:*@Component(factory="anFactoryPID")*

Couple years ago, I used to use the ConfigAdmin directly to activate my
mult-instance components and the information you want was only provided
by the Configuration object returned from CM:

configuration = getConfigurationAdmin()
                     .createFactoryConfiguration(pFactoryPid, null);
factoryPID = configuration.getFactoryPid();
pid = configuration.getPid()
I just started with Configurator too, but I don't know if this FPID and
PID information are being published in the configuration map currently
also. CM used not do that until R6 (at least I was not able to find them).




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to