You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benson Margulies <be...@basistech.com> on 2016/08/31 12:39:56 UTC

Semantics of Require-Capability of a service derived from DS @Reference

The maven-bundle-plugin, in some cases, with _dsannotations enabled,
produces Require-Capability instructions like the following:

Require-Capability: osgi.service;filter:="(objectClass=com.basistech.ros
 ette.osgi.Bus)";effective:=active,osgi.ee;filter:="(&(osgi.ee=JavaSE)(v
 ersion=1.8))"

I only noticed them when Karaf 4.0.6 stopped being able to resolve
these. I assume that these derive somehow from DS @References, but the
filters in the DS references are not fully copied into here.

The service in question is activated by a bundle that is present in
the overall provisioning, but apparently is not starting before the
Karaf resolver gets going. Are these instructions required for DS? I'm
about to try switching to the bnd-maven-plugin and see if I see
anything different.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Semantics of Require-Capability of a service derived from DS @Reference

Posted by Benson Margulies <be...@basistech.com>.
On Wed, Aug 31, 2016 at 7:44 AM, Neil Bartlett <nj...@gmail.com> wrote:
> It looks like you have solved this problem over in the bndtools-users list, but I want to point out one small misapprehension:

Yes, thanks, and thanks for the clarification.

>
>> On 31 Aug 2016, at 13:39, Benson Margulies <be...@basistech.com> wrote:
>>
>> The maven-bundle-plugin, in some cases, with _dsannotations enabled,
>> produces Require-Capability instructions like the following:
>>
>> Require-Capability: osgi.service;filter:="(objectClass=com.basistech.ros
>> ette.osgi.Bus)";effective:=active,osgi.ee;filter:="(&(osgi.ee=JavaSE)(v
>> ersion=1.8))"
>>
>> I only noticed them when Karaf 4.0.6 stopped being able to resolve
>> these. I assume that these derive somehow from DS @References, but the
>> filters in the DS references are not fully copied into here.
>>
>> The service in question is activated by a bundle that is present in
>> the overall provisioning, but apparently is not starting before the
>> Karaf resolver gets going.
>
> The started state of the bundle providing these services is irrelevant. A Require-Capability header is always matched by a Provide-Capability header. The bundle that Provides the capability does not need to be started, it only needs to be resolved or resolvable.
>
> By the way, the correct way to read such a Provide-Capability header is not that the bundle always provides the service but that it has the *potential* to provide a service, some of the time… if it feels like it. That’s why these requirements and capabilities are effective:=active, they should only be treated as hints to a provisioning agent and not as instructions to the OSGi Framework.
>
>
>
>> Are these instructions required for DS? I'm
>> about to try switching to the bnd-maven-plugin and see if I see
>> anything different.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Semantics of Require-Capability of a service derived from DS @Reference

Posted by Neil Bartlett <nj...@gmail.com>.
It looks like you have solved this problem over in the bndtools-users list, but I want to point out one small misapprehension:

> On 31 Aug 2016, at 13:39, Benson Margulies <be...@basistech.com> wrote:
> 
> The maven-bundle-plugin, in some cases, with _dsannotations enabled,
> produces Require-Capability instructions like the following:
> 
> Require-Capability: osgi.service;filter:="(objectClass=com.basistech.ros
> ette.osgi.Bus)";effective:=active,osgi.ee;filter:="(&(osgi.ee=JavaSE)(v
> ersion=1.8))"
> 
> I only noticed them when Karaf 4.0.6 stopped being able to resolve
> these. I assume that these derive somehow from DS @References, but the
> filters in the DS references are not fully copied into here.
> 
> The service in question is activated by a bundle that is present in
> the overall provisioning, but apparently is not starting before the
> Karaf resolver gets going.

The started state of the bundle providing these services is irrelevant. A Require-Capability header is always matched by a Provide-Capability header. The bundle that Provides the capability does not need to be started, it only needs to be resolved or resolvable.

By the way, the correct way to read such a Provide-Capability header is not that the bundle always provides the service but that it has the *potential* to provide a service, some of the time… if it feels like it. That’s why these requirements and capabilities are effective:=active, they should only be treated as hints to a provisioning agent and not as instructions to the OSGi Framework.



> Are these instructions required for DS? I'm
> about to try switching to the bnd-maven-plugin and see if I see
> anything different.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org