You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Ioannis Canellos <io...@gmail.com> on 2011/01/21 18:00:33 UTC

Managed Service Factories

Hi all,

I am using a managed service factory (via springdm) to create instances of a
service:

<osgix:managed-service-factory factory-pid="net.iocanel.someservice"
update-strategy="container-managed" auto-export="all-classes">
     <bean class="net.iocanel.SomeService"/>
</osgix:managed-service-factory>

>From the karaf shell I use the config command to create a new instance of
that service say "instance1":

karaf@root> config:edit net.iocanel.someservice-instance1
karaf@root> config:propset somekey somevalue
karaf@root> config:update

As a result a new instance of the service is created and the configuration
is persisted in the file etc/net.iocanel.someservice-instance1.cfg
The problem is that its assigned a random service.pid of the
form net.iocanel.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf and when I
try to update the configuration

karaf@root> config:edit net.iocanel.someservice-instance1

It doesn't work. Instead I have to use the assigned pid  (which requires me
to perform a config:list and then use correlate):

karaf@root>
config:edit net.iocanel.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf


I might miss some piece of information here. Has anyone else had encountered
similar issues?


-- 
*Ioannis Canellos*
http://iocanel.blogspot.com
Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>

Re: Managed Service Factories

Posted by Ioannis Canellos <io...@gmail.com>.
Yes, and it does not work.

The problem is that Pid and FactoryPid are not properties.
Here is what I have in the config list:

Pid:
net.iocanel.someservice-instance1.dfd6eb6f-061c-4030-8e4d-5861d582669d
FactoryPid:     net.iocanel.someservice-instance1
BundleLocation: null
Properties:
   Pid: net.iocanel.someservice-instance1
   somekey = somevalue
   sevice.pid = net.iocanel.someservice-instance1
   felix.fileinstall.filename = net.iocanel.someservice-instance1



On Fri, Jan 21, 2011 at 7:10 PM, Guillaume Nodet <gn...@gmail.com> wrote:

> Have you tries something like:
>
> karaf@root> config:edit net.iocanel.someservice-instance1
> karaf@root> config:propset somekey somevalue
> karaf@root> config>propset service.factoryPid net.iocanel.someservice
> karaf@root> config:update
>
>
> On Fri, Jan 21, 2011 at 18:00, Ioannis Canellos <io...@gmail.com> wrote:
> > Hi all,
> >
> > I am using a managed service factory (via springdm) to create instances
> of a
> > service:
> >
> > <osgix:managed-service-factory factory-pid="net.iocanel.someservice"
> > update-strategy="container-managed" auto-export="all-classes">
> >     <bean class="net.iocanel.SomeService"/>
> > </osgix:managed-service-factory>
> >
> > From the karaf shell I use the config command to create a new instance of
> > that service say "instance1":
> >
> > karaf@root> config:edit net.iocanel.someservice-instance1
> > karaf@root> config:propset somekey somevalue
> > karaf@root> config:update
> >
> > As a result a new instance of the service is created and the
> configuration
> > is persisted in the file etc/net.iocanel.someservice-instance1.cfg
> > The problem is that its assigned a random service.pid of the
> > form net.iocanel.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf and
> when I
> > try to update the configuration
> >
> > karaf@root> config:edit net.iocanel.someservice-instance1
> >
> > It doesn't work. Instead I have to use the assigned pid  (which requires
> me
> > to perform a config:list and then use correlate):
> >
> > karaf@root>
> > config:edit net.iocanel.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf
> >
> >
> > I might miss some piece of information here. Has anyone else had
> encountered
> > similar issues?
> >
> >
> > --
> > *Ioannis Canellos*
> > http://iocanel.blogspot.com
> > Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>
> >
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>

Re: Managed Service Factories

Posted by Guillaume Nodet <gn...@gmail.com>.
Have you tries something like:

karaf@root> config:edit net.iocanel.someservice-instance1
karaf@root> config:propset somekey somevalue
karaf@root> config>propset service.factoryPid net.iocanel.someservice
karaf@root> config:update


On Fri, Jan 21, 2011 at 18:00, Ioannis Canellos <io...@gmail.com> wrote:
> Hi all,
>
> I am using a managed service factory (via springdm) to create instances of a
> service:
>
> <osgix:managed-service-factory factory-pid="net.iocanel.someservice"
> update-strategy="container-managed" auto-export="all-classes">
>     <bean class="net.iocanel.SomeService"/>
> </osgix:managed-service-factory>
>
> From the karaf shell I use the config command to create a new instance of
> that service say "instance1":
>
> karaf@root> config:edit net.iocanel.someservice-instance1
> karaf@root> config:propset somekey somevalue
> karaf@root> config:update
>
> As a result a new instance of the service is created and the configuration
> is persisted in the file etc/net.iocanel.someservice-instance1.cfg
> The problem is that its assigned a random service.pid of the
> form net.iocanel.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf and when I
> try to update the configuration
>
> karaf@root> config:edit net.iocanel.someservice-instance1
>
> It doesn't work. Instead I have to use the assigned pid  (which requires me
> to perform a config:list and then use correlate):
>
> karaf@root>
> config:edit net.iocanel.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf
>
>
> I might miss some piece of information here. Has anyone else had encountered
> similar issues?
>
>
> --
> *Ioannis Canellos*
> http://iocanel.blogspot.com
> Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com