Not sure if this is correct.
At least when looking at the
org.osgi.service.cm.ManagedServiceFactory.updated(String pid, Dictionary
properties) method.
There pid is the full name <factory name>-<generated name>.
Not sure about how it is generally called in the spec document but at
least in this interface "pid" means the combined value.
Christian
On 03.07.2014 13:08, Achim Nierbeck wrote:
Yes and no,
the PID is the part before the "-" since it is the actual PID as can
also be read in the OSGi spec.
the Factory PID is the part after the "-" but in our case will be
replaced by the "random" Identifier.
So yes, this is confusing since we are talking actually of a PID for
the Factory, but the PID does describe the service PID which is right
for the service as this PID is bound to the Factory creating the
service, where the actual Factory PID is a random ID.
regards, Achim
2014-07-03 12:30 GMT+02:00 Benjamin Debeerst
<[email protected] <mailto:[email protected]>>:
Sorry to pull this up again, but what you write seems weird to me:
The factory PID should be what is before the '-', not what is
after the '-'. Consider the configurations I attached earlier: For
TestConfig-Instance1, 'TestConfig' is the Factory PID, while
'Instance1' is just some random identifier.
Regards,
Benjamin
-----Original Message-----
From: Jean-Baptiste Onofré [mailto:[email protected]
<mailto:[email protected]>]
Sent: Mittwoch, 2. Juli 2014 17:35
To: [email protected] <mailto:[email protected]>
Subject: Re: Problems With Factory Configurations In Karaf 3.0.1
It is:
pid.indexOf returns the index of the '-'.
If it's found (>0), the factoryPid is the string after the -.
The Pid is the string before the -.
So it looks good to me.
Regards
JB
On 07/02/2014 05:27 PM, Gareth wrote:
> Hello Benjamin,
>
> I think theproblem is that the names of the variables are
> incorrect/confusing. Look at the parsePid method in the same file
>
> private String[] parsePid(String pid) {
> int n = pid.indexOf('-');
> if (n > 0) {
> String factoryPid = pid.substring(n + 1);
> pid = pid.substring(0, n);
> return new String[]{pid, factoryPid};
> } else {
> return new String[]{pid, null};
> }
> }
>
> The factory pid is definitely not the string after the "-" as
> suggested here.
>
> Gareth
>
> Gareth
>
>
>
> --
> View this message in context:
>
http://karaf.922171.n3.nabble.com/Problems-With-Factory-Configurations
> -In-Karaf-3-0-1-tp4033921p4033954.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
[email protected] <mailto:[email protected]>
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Software Architect / Project Manager / Scrum Master
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com