felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3089) A component without ServicePermissions cannot be registered as a service
Date Mon, 29 Aug 2011 06:55:39 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092666#comment-13092666
] 

Felix Meschberger commented on FELIX-3089:
------------------------------------------

Agreed. I think this is this piece of code verifying dependencies:

            if ( !dm.hasGetPermission() ) {
                // bundle has no service get permission
**             satisfied = false;
            } else if ( !dm.isSatisfied() ) {
                // bundle would have permission but there are not enough services
                satisfied = false;
            }

At ** we should probably assume satisfaction if the reference is optional.

> A component without ServicePermissions cannot be registered as a service
> ------------------------------------------------------------------------
>
>                 Key: FELIX-3089
>                 URL: https://issues.apache.org/jira/browse/FELIX-3089
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions:  scr-1.6.0
>            Reporter: Yasuhiro Kawame
>
> Given the following Component XML
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component immediate="true" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
>   <implementation class="BindingImpl" />
>   <reference
>     bind="bind"
>     unbind="unbind"
>     policy="dynamic"
>     cardinality="0..1"
>     interface="ServiceProvider"
>   />
>   <service>
>     <provide interface="Binding" />
>   </service>
> </scr:component>
> When this component's bundle does not have ServicePermission[ServiceProvider , GET],
Binding is not registered as a service.
> But I think that Binding can be registered.
> Because the component's reference specifies optional cardinality.
> (see OSGi Compendium R4.2
>        112.3.2 Reference Cardinality, 112.9.1 Service Permissions)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message