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]] 
Sent: Mittwoch, 2. Juli 2014 17:35
To: [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]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to