You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Thomas Driessen <th...@gmail.com> on 2018/01/10 11:41:24 UTC
Adding service programmatically so SCR sees it
Hi,
I had to write my own extender and am adding services via
bundleContext.registerService(...)
When I type "list" into gogo shell, these services are not listed.
As the "list" command is provided by SCR I guess that SCR must be made
aware of my service in order to list it.
Is there a way to make SCR aware of services that I registered
programmatically?
If not, are there other commands to get a list of registered services?
Kind regards,
Thomas
Re[2]: Adding service programmatically so SCR sees it
Posted by Thomas Driessen <th...@gmail.com>.
Thank you for this fast answer.
inspect cap service
with grep did the trick!
------ Originalnachricht ------
Von: "Neil Bartlett" <nj...@gmail.com>
An: "users" <us...@felix.apache.org>; "Thomas Driessen"
<th...@gmail.com>
Gesendet: 10.01.2018 12:46:38
Betreff: Re: Adding service programmatically so SCR sees it
>The SCR commands are only aware of Components, as defined by the DS
>specification.
>
>When you register a service using BundleContext#registerService, what
>you
>have created is not a Component, but only an entry in the service
>registry.
>Not all services are component and, incidentally, not all components
>provide services.
>
>The command you are looking for is "inspect". You can use this to list
>the
>provided services of bundle id N by typing:
>
> inspect cap service N
>
>Where 'cap' is short for 'capability', i.e. provided rather than
>consumed.
>If you omit the bundle id then it will list all services of all
>bundles...
>there will be a lot.
>
>Neil
>
>On Wed, Jan 10, 2018 at 11:41 AM, Thomas Driessen <
>thomas.driessen.td@gmail.com> wrote:
>
>>Hi,
>>
>>I had to write my own extender and am adding services via
>>
>>bundleContext.registerService(...)
>>
>>When I type "list" into gogo shell, these services are not listed.
>>As the "list" command is provided by SCR I guess that SCR must be made
>>aware of my service in order to list it.
>>
>>Is there a way to make SCR aware of services that I registered
>>programmatically?
>>
>>If not, are there other commands to get a list of registered services?
>>
>>Kind regards,
>>Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Adding service programmatically so SCR sees it
Posted by Neil Bartlett <nj...@gmail.com>.
The SCR commands are only aware of Components, as defined by the DS
specification.
When you register a service using BundleContext#registerService, what you
have created is not a Component, but only an entry in the service registry.
Not all services are component and, incidentally, not all components
provide services.
The command you are looking for is "inspect". You can use this to list the
provided services of bundle id N by typing:
inspect cap service N
Where 'cap' is short for 'capability', i.e. provided rather than consumed.
If you omit the bundle id then it will list all services of all bundles...
there will be a lot.
Neil
On Wed, Jan 10, 2018 at 11:41 AM, Thomas Driessen <
thomas.driessen.td@gmail.com> wrote:
> Hi,
>
> I had to write my own extender and am adding services via
>
> bundleContext.registerService(...)
>
> When I type "list" into gogo shell, these services are not listed.
> As the "list" command is provided by SCR I guess that SCR must be made
> aware of my service in order to list it.
>
> Is there a way to make SCR aware of services that I registered
> programmatically?
>
> If not, are there other commands to get a list of registered services?
>
> Kind regards,
> Thomas