Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 475C7200B7D for ; Sat, 27 Aug 2016 01:07:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 45F0B160AC8; Fri, 26 Aug 2016 23:07:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 95095160AB6 for ; Sat, 27 Aug 2016 01:07:21 +0200 (CEST) Received: (qmail 81095 invoked by uid 500); 26 Aug 2016 23:07:20 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 81052 invoked by uid 99); 26 Aug 2016 23:07:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2016 23:07:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 822B02C0031 for ; Fri, 26 Aug 2016 23:07:20 +0000 (UTC) Date: Fri, 26 Aug 2016 23:07:20 +0000 (UTC) From: "Pierre De Rop (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FELIX-5337) Filter-based dependencies working differently for annotations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 26 Aug 2016 23:07:22 -0000 [ https://issues.apache.org/jira/browse/FELIX-5337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15440137#comment-15440137 ] Pierre De Rop commented on FELIX-5337: -------------------------------------- thanks for reporting. I have reproduce the issue in https://github.com/pderop/dm.felix5337 In the project above, the two service.v1 and service.v2 bundles provides two versions of the same service. Now, the catchall.withapi bundle uses the DM api and is able to lookup all services, including service.v1, and service.v2. the catchall.withapi does this: {code} dm.add(createComponent() .setImplementation(CatchAll.class) .add(createServiceDependency().setService("(objectClass=*)").setRequired(false).setCallbacks("addService", null))); {code} this is working fine. But the catchall.withannotation bundle does not work. It only catches one service, not all the others. It does this: {code} @ServiceDependency(filter="(objectClass=*)", required = false) void addService(Object service, Map properties) { System.out.println("Got service " + service + " with properties: " + properties); } {code} After investigating, it turns out that the issue is the following: the runtime infers the service type using the signature of the addService method. So, it internally uses the DM api and does this: {code} setService(Object.class, "(objectClass=*)") {code} and this does not work: we don't catch all services, only one. So, to summarize, the following works (and this is what catchall.withapi does): {code} createServiceDependency().setService("(objectClass=*)").setRequired(false).setCallbacks(...) {code} but the following does not work (this is what the runtime internally does): {code} createServiceDependency().setService(Object.class, "(objectClass=*)").setRequired(false).setCallbacks(...) {code} I will continue to investigate this WE. > Filter-based dependencies working differently for annotations > ------------------------------------------------------------- > > Key: FELIX-5337 > URL: https://issues.apache.org/jira/browse/FELIX-5337 > Project: Felix > Issue Type: Bug > Affects Versions: dependencymanager-4.3.0 > Reporter: J.W. Janssen > > I've got a "catch all" service dependency that simply wants to see *all* services being registered. In the activator based implementation I simply express my dependency as {{createServiceDependency().setService("(objectClass=*)").setRequired(false).setCallbacks("addService", "removeService")}} and I get all services I'm interested in (I mean: each and every registered service). > However, if I rewrite my code to use annotations using {{@ServiceDependency(filter="(objectClass=*)", required = false, removed = ...)}}, I suddenly do not see all services I expect: only services that seem to be compatible with the class-space of the bundle my code lives in. -- This message was sent by Atlassian JIRA (v6.3.4#6332)