Return-Path: X-Original-To: apmail-sling-dev-archive@www.apache.org Delivered-To: apmail-sling-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 0E6EE10D49 for ; Mon, 3 Feb 2014 08:52:19 +0000 (UTC) Received: (qmail 21520 invoked by uid 500); 3 Feb 2014 08:52:16 -0000 Delivered-To: apmail-sling-dev-archive@sling.apache.org Received: (qmail 21244 invoked by uid 500); 3 Feb 2014 08:52:15 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 21226 invoked by uid 99); 3 Feb 2014 08:52:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 08:52:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of fmeschbe@adobe.com) Received: from [207.46.163.207] (HELO na01-bl2-obe.outbound.protection.outlook.com) (207.46.163.207) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 08:52:06 +0000 Received: from DM2PR02MB446.namprd02.prod.outlook.com (10.141.88.16) by DM2PR02MB445.namprd02.prod.outlook.com (10.141.88.12) with Microsoft SMTP Server (TLS) id 15.0.868.8; Mon, 3 Feb 2014 08:51:23 +0000 Received: from DM2PR02MB446.namprd02.prod.outlook.com ([10.141.88.16]) by DM2PR02MB446.namprd02.prod.outlook.com ([10.141.88.16]) with mapi id 15.00.0868.013; Mon, 3 Feb 2014 08:51:23 +0000 From: Felix Meschberger To: "dev@sling.apache.org" Subject: Re: [osgi] Using Inventory API in Commons Log Thread-Topic: [osgi] Using Inventory API in Commons Log Thread-Index: AQHPILwJL5QiDFNgukO/k6KxkyzZHJqjOL8A Date: Mon, 3 Feb 2014 08:51:23 +0000 Message-ID: <9DABDE99-222C-493A-BB71-9D08E64ABBA3@adobe.com> References: In-Reply-To: Accept-Language: de-CH, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.105.139.131] x-forefront-prvs: 01110342A5 x-forefront-antispam-report: SFV:NSPM;SFS:(10019001)(6009001)(51694002)(51704005)(189002)(199002)(33656001)(77982001)(74662001)(56776001)(54316002)(90146001)(65816001)(79102001)(93136001)(94946001)(93516002)(80022001)(59766001)(31966008)(63696002)(74502001)(81542001)(47446002)(56816005)(87936001)(19580395003)(2656002)(19580405001)(83322001)(85306002)(80976001)(87266001)(83716003)(66066001)(86362001)(92566001)(92726001)(83072002)(85852003)(4396001)(74876001)(76796001)(74366001)(46102001)(82746002)(76482001)(81816001)(81686001)(94316002)(69226001)(81342001)(53806001)(54356001)(51856001)(76786001)(74706001)(47976001)(36756003)(47736001)(49866001)(50986001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR02MB445;H:DM2PR02MB446.namprd02.prod.outlook.com;CLIP:193.105.139.131;FPR:7FF2F285.9E22DDC3.F1E9AC77.8AD1B1E9.2025B;InfoNoRecordsMX:1;A:1;LANG:en; Content-Type: text/plain; charset="iso-8859-1" Content-ID: <5241A6161F15984296C45431537E2F1C@namprd02.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: adobe.com X-Virus-Checked: Checked by ClamAV on apache.org Hi Am 03.02.2014 um 09:41 schrieb Chetan Mehrotra : > Hi, >=20 > For SLING-3264 I was thinking to provide Inventory integration in > Commons Logs. However the Commons Log bundle starts at level 1 while > the Inventory bundle starts at Level 5. The log bundle would use the > ServiceFactory approach to expose the Inventory service and would not > have required dependency on Inventory API. >=20 > So just wanted to confirm that would it be fine to depend on classes > from a bundle which starts at later start level or not? Sure. This is what we are using ServiceFactory and dynamic/delayed import a= ll over places. See for example the Configuration Admin binding the Apache = Felix SCR bundle. So, what seems to boild down to kind of a best practice is to: * use ServiceFactory for optional services * use Import-Package with resolution:=3Doptional to have=20 static wiring if possible * use DynamicImport-Package to have dynamic wiring on-demand It is just very important to thouroughly test this to not get inadvertend C= lassNotFoundExceptions, for example if the optional classes appear in the m= ethod signature of a required class (see the ResourceResolverActivator.getF= eaures() method which returns Object to work around this issue). Regards Felix=