Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EE459DB2 for ; Tue, 5 Jun 2012 01:36:56 +0000 (UTC) Received: (qmail 49740 invoked by uid 500); 5 Jun 2012 01:36:56 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 49703 invoked by uid 500); 5 Jun 2012 01:36:56 -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 49693 invoked by uid 99); 5 Jun 2012 01:36:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 01:36:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [76.13.13.46] (HELO smtp107.prem.mail.ac4.yahoo.com) (76.13.13.46) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 Jun 2012 01:36:49 +0000 Received: (qmail 94248 invoked from network); 5 Jun 2012 01:36:28 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=NIn/MKwcklYsZ/qV/U6mS38Ua9MMLD4J1pWU8T0w6qgmUTo4l0M3gRhsSOUGFRBMJS9AF1eV0kwLiy/dLP37GRnMUinLIvCS9CYJEqU0qOuKgJ47fjVd3VZywDHhQepCWYbkjOA2ddB8ZvrYB8ClvnxdCEVN3vTrULGox+hNXck= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1338860188; bh=6UbUFdFYh3ahd1UW11TB1wvivZ0QfDqX5un9YMrQnGs=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=X1w+KOoiGgid80cNQUT8C1RROgvUQ3nWyXea2d/9VidtxyhpMnK+mlpDqtb7hEX3RIZqyEjjfwvd3xkw62vb7aP3JTzbvEGbAaUm44MAwDDtT/w5RL1PrwQnTGBUU0PAAB0n3eUNGdDqGURz7pgYD67jyZVav3RdZwcS8ZYKd+8= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: CJ.FBpgVM1lgU1MYg2ECHakIBVmR1SPr2ElBGzz26ZDwxzJ kMOLR.8mWqRxOUrfEKXx8_voWXEVi24y.4TZXdMgl8KhbLvH.n_K18xA9DLb 27HOure32BUqlwImuk5LU8Ej9Mm1U1WbgH4es9u_fHnsURpftq_PbmxlAgK2 yM4w7ZojxUCjq1hvEEd_gtALFmb9GHKF5jnfzPID28.CG7oS.1v7S3oBMP0E qJxUU_Gg6woHkUOCvHeluaVx.nyupKbyKRhvGe7CggPpibDGTvngQVtC5WQu JSnymWS7mggF7YCzjBWtFGXZZb3hxmVsd3RpJlHjByVAoZs1NoHVUDTU06az 7Ae8pq6sryfyw.g6IUnOdXsbdaOZf1R8px3F3O1WVsgC5IZXV3On53PZRi9m 7kH_57OA6bhRJVXzjXWa3b4jJVOAKrRc- X-Yahoo-SMTP: .9oIUzyswBANsYgUm_5uPui0skTnzGJXJQ-- Received: from [192.168.1.114] (david_jencks@24.21.161.207 with plain) by smtp107.prem.mail.ac4.yahoo.com with SMTP; 04 Jun 2012 18:36:27 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: [DS] [lifecycle methods returning service properties] How should this work? From: David Jencks In-Reply-To: <890DEFDE-27B5-46A6-93EE-038D853C1471@adobe.com> Date: Mon, 4 Jun 2012 18:36:25 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <2E584B90-4F2A-45D5-B350-D4F18C2659AA@yahoo.com> References: <01B24EA9-413D-4E5D-A48E-3F742688F39D@yahoo.com> <890DEFDE-27B5-46A6-93EE-038D853C1471@adobe.com> To: dev@felix.apache.org X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org On Jun 4, 2012, at 11:13 AM, Felix Meschberger wrote: > Hi, >=20 > Am 04.06.2012 um 19:16 schrieb David Jencks: >=20 >> cf FELIX-3506, 3377. >>=20 >> Right now we have it set up so that a lifecycle method can return the = exact set of service properties it wants the service registration to = have. I'm not at all sure this is a plausible way to operate since = usually you'd use this feature to set or unset a flag in the service = properties based on some aspect of the component state. I could be = missing something, but I don't see an easy way to get the existing set = of service properties so you can modify them with your flag. I did = something like this: >>=20 >> serviceProperties.clear(); >> for (String key : cc.getServiceReference().getPropertyKeys()) { >> serviceProperties.put(key, = cc.getServiceReference().getProperty(key)); >> } >> //now actually add/remove my flag >>=20 >>=20 >> I think it would be a lot more usable to have the lifecycle methods = return a map of changes, where a null value for a key means "remove the = key". >>=20 >> Have I missed an easy way to use the current implementation? >=20 > Basically the service registration by default are all = ComponentContext.getProperties() with the exception of the properties = with a leading dot (considering them private properties). >=20 > So the idea of returning the complete map is to give the component = full and simple control. And because the properties are fully available = in all activator methods (activate, modify, deactivate) through either = the ComponentContext or the configuration Map this is really = straight-forward IMHO. >=20 > So I would prefer to keep those as is. I'm OK with this as long as we strip out the private . properties... see = FELIX-3533. david jencks >=20 > Regards > Felix