felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Reich <jeanbaptiste.re...@gmail.com>
Subject Re: iPOJO with a singleton component managed by Config Admin
Date Tue, 22 Feb 2011 10:25:47 GMT
Thank you for your answer.

I can't use annotations so I guess that I can declare my component in the
metadata.xml like this:

<component classname="test.MyService" name="MyService" public="false">
    <provides />
    <properties pid="test.MyService">

       ...

    </properties></component>


<instance ...>

</instance>


But in the xml file we do not specify if it is a ManagedService or a
ManagedServiceFactory ? How can I know which service is registered ?


Thank you


2011/2/21 Clement Escoffier <clement.escoffier@gmail.com>

> Hi,
>
> On 21.02.11 16:26, "Jean-Baptiste Reich" <jeanbaptiste.reich@gmail.com>
> wrote:
>
> >Hello,
> >
> >I am reading the iPOJO documentation but I don't see how I can handle the
> >creation of a singleton component when a configuration in config admin is
> >there.
> >My problem is to wait until a configuration is available for a given pid
> >and
> >to create the unique instance of my component at that moment.
> >
> >I have seen that I could declare a factory on my component which results
> >in
> >the creation of a ManagedServiceFactory but with that I can't limit the
> >number of instances...
> >
> >Another way is to declare a private component with a pid and to declare my
> >single instance in the metadata.xml but like this my object is created
> >even
> >if I don't have configuration in config admin...
> >
> >Is there a way to do that ?
>
> You can also expose a ManagedService using:
> @Component(managedservice=pid, publicFactory=false)
>
> Where pid is the desired managed service pid.
>
> Regards,
>
> Clement
>
> >
> >Thanks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message