You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by SvS <Du...@solcon.nl> on 2015/02/17 17:12:51 UTC

Re: Mandatory Configuration from configAdmin

Hi JB,

Is a jira issue created?

Is there a way to see that all the configurations for a bundle is loaded by
the config admin? In may case it is a service factory.

Regards,
SvS



--
View this message in context: http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038601.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Mandatory Configuration from configAdmin

Posted by SvS <Du...@solcon.nl>.
I use ManagedServiceFactory with blueprint. What is necessary that the
existing (persistent) configurations are loaded and the associated services
are created before an automatic process will re-create it. (This is to avoid
'duplicate' services.)



--
View this message in context: http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038610.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Mandatory Configuration from configAdmin

Posted by Ryan Moquin <fr...@gmail.com>.
Multiple of the same service type?  If you have service references to the
expected services and they are mandatory, then the bundle won't finish
resolving until the service dependencies are met.
On Feb 18, 2015 8:44 AM, "SvS" <Du...@solcon.nl> wrote:

> Hi Ryan,
>
> I use a similar construction with ManagedServiceFactories. But I need to
> know when all services are created. (There are multiple configurations
> which
> results in multiple services.)
>
> Do you have a suggestion for this purpose?
>
> Regards,
> SvS.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038611.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Mandatory Configuration from configAdmin

Posted by SvS <Du...@solcon.nl>.
Hi Ryan,

I use a similar construction with ManagedServiceFactories. But I need to
know when all services are created. (There are multiple configurations which
results in multiple services.)

Do you have a suggestion for this purpose?

Regards,
SvS.



--
View this message in context: http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038611.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Mandatory Configuration from configAdmin

Posted by Ryan Moquin <fr...@gmail.com>.
I actually ran into this same problem and I was able to fix it by doing
this:

    <cm:cm-properties persistent-id="my.pid" update="true"/>
    <cm:property-placeholder persistent-id="my.pid"
update-strategy="reload"/>

I'm pretty sure the reason this is the correct way to do it and that it
works correctly is because the property-placeholder is by default not meant
to specify a mandatory set of configuration properties (otherwise the
default values element would be pointless).  By adding the cm-properties,
your bundle will wait for the configuration to be available and then if any
properties are still not present, it will pull them from the defaults.

If that logic isn't correct, feel free to correct me.  I do know however
that my solution has worked perfectly for me in all cases I've used it so
far.

Ryan

On Tue, Feb 17, 2015 at 11:48 AM, James Carman <ja...@carmanconsulting.com>
wrote:

> What about using a ManagedServiceFactory instead?
>
> On Tue, Feb 17, 2015 at 11:12 AM, SvS <Du...@solcon.nl> wrote:
> > Hi JB,
> >
> > Is a jira issue created?
> >
> > Is there a way to see that all the configurations for a bundle is loaded
> by
> > the config admin? In may case it is a service factory.
> >
> > Regards,
> > SvS
> >
> >
> >
> > --
> > View this message in context:
> http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038601.html
> > Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Mandatory Configuration from configAdmin

Posted by James Carman <ja...@carmanconsulting.com>.
What about using a ManagedServiceFactory instead?

On Tue, Feb 17, 2015 at 11:12 AM, SvS <Du...@solcon.nl> wrote:
> Hi JB,
>
> Is a jira issue created?
>
> Is there a way to see that all the configurations for a bundle is loaded by
> the config admin? In may case it is a service factory.
>
> Regards,
> SvS
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038601.html
> Sent from the Karaf - User mailing list archive at Nabble.com.