felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre De Rop (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-2875) Improve the setService() methods in the ServiceDependencyImpl to allow null for the service name.
Date Thu, 23 Oct 2014 15:47:34 GMT

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

Pierre De Rop commented on FELIX-2875:
--------------------------------------

Hello Marcel, Tuomas,

May we close this old issue, as well as the related FELIX-3949 issue ? Indeed, I think that
currently, defining a service dependency without giving the service name (using ServiceDependency.setService(String
filter) method) is working fine, and I have committed a testcase in [1] to verify it. 

The only thing that must be done when using the ServiceDependency.setService(String filter)
method is that you must specify a callback with an "Object" signature, or you must use an
Object field if you are using autoconfig.
Regarding the exception reported by Tuomas, I think it was caused by an optional autoconfig
dependency, and for unavailable optional autoconfig dependencies, NullObjects are used, but
they only work for interfaces, not for Objects... So, for optional dependencies without specifying
the service name, a callback should be used (NullObjects are not used with callbacks).

so, do you agree if I close this issue, as well as the  FELIX-3949 issue ?

thanks;
/Pierre

[1] http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2875_ServiceDependencyWithoutServiceNameTest.java

> Improve the setService() methods in the ServiceDependencyImpl to allow null for the service
name.
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-2875
>                 URL: https://issues.apache.org/jira/browse/FELIX-2875
>             Project: Felix
>          Issue Type: Improvement
>          Components: Dependency Manager
>            Reporter: Marcel Offermans
>            Assignee: Marcel Offermans
>
> The setService() methods are currently a bit more strict than necessary, not allowing
you to, for example, specify only a filter condition via the method called setService(Class
name, String filter). This in turn limits the options you have when creating adapters. Fix
this problem and factor out any redundant code in these methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message