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 E8ADF200B35 for ; Tue, 5 Jul 2016 15:30:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E6F96160A60; Tue, 5 Jul 2016 13:30:38 +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 16DB6160A2C for ; Tue, 5 Jul 2016 15:30:37 +0200 (CEST) Received: (qmail 56811 invoked by uid 500); 5 Jul 2016 13:30:36 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 56799 invoked by uid 99); 5 Jul 2016 13:30:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2016 13:30:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5B2FE1A5E52 for ; Tue, 5 Jul 2016 13:30:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.18 X-Spam-Level: * X-Spam-Status: No, score=1.18 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_DBL_ABUSE_REDIR=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=cloudsoftcorp.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5q0TXy6qb-3W for ; Tue, 5 Jul 2016 13:30:32 +0000 (UTC) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 4808E5F19A for ; Tue, 5 Jul 2016 13:30:32 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id r201so152830751wme.1 for ; Tue, 05 Jul 2016 06:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudsoftcorp.com; s=google; h=from:message-id:mime-version:subject:date:references:to:in-reply-to; bh=F98gWxkm3EoqNvVuLDB/cr+wIrfz0wWys7ki2U4n+g4=; b=KViHFG4ZLHwqD0v35ys81oFJoWbyU7Srpv6eTOM8BWkmYYfcXe+mA+lDaGeUMEqlrU x6S1PR1nWAIdgGQh9r2NPJjTSEBs9/sPACr3SryeeRhkiRZ+bgx3EWXNX2Wf+NQ+uy8i T5nzyKwF5+eoYyEFwXCcxS5m9m8zoI8vJf2lA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:mime-version:subject:date :references:to:in-reply-to; bh=F98gWxkm3EoqNvVuLDB/cr+wIrfz0wWys7ki2U4n+g4=; b=k5sdqlBvf/XeG3SD2plhZ93b6PyeNJjfZCC6o4Mxe1Av8fUKdqXz6OwkK+XVx0JzQu /kIIZNAlupvzpL1QD2QCq8iKgtrULJ4JqecqJBswzGs2AdUe3FHD7VYjuf/V8JHo86pZ jUjKRzkjxuBWNM9/F//VckZsfHyxVbabT3L5POgF0fr20TihaM2RgIW0hvIDxuTBiyzM sUOCdLsPP0knJryBSL26Ld50+l9y0XyTszzWVkyij33R2VZU2OWGCqRhf6sjelU7bCBM FZo02/CsdHVh3E+mvuWr+WWdVLS+NRrYMZpQBDt9vSajs0eNTqeOsuYdQAFQ9j2Z68td 72sg== X-Gm-Message-State: ALyK8tI/mQmPpI+djxN6/NZpwSD0k2Xnc3MCH7R+RS2XCQaaFSogK9ACQZP6e+PXlAt1MoBoVO4I/LrS4Bpwp5go6Lt4qcwL+8XJ7EL0KxVbcS5Vsaw1DG9gxZiwmE1W+RH5kA== X-Received: by 10.194.22.169 with SMTP id e9mr15456785wjf.128.1467725425997; Tue, 05 Jul 2016 06:30:25 -0700 (PDT) Received: from [10.10.205.112] ([212.250.191.72]) by smtp.gmail.com with ESMTPSA id jf3sm4494295wjb.41.2016.07.05.06.30.25 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jul 2016 06:30:25 -0700 (PDT) From: Geoff Macartney Content-Type: multipart/alternative; boundary="Apple-Mail=_E3DB26DA-3518-4796-87BF-1FA8BB68A423" Message-Id: <27446D5A-7255-4294-9B5F-EA9CD6F3E7F1@cloudsoftcorp.com> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PROPOSAL] Class loading fallback in Karaf Date: Tue, 5 Jul 2016 14:30:24 +0100 References: <2E942F22-058C-4ED1-AF3A-A61A70E060E6@cloudsoftcorp.com> To: dev@brooklyn.apache.org In-Reply-To: <2E942F22-058C-4ED1-AF3A-A61A70E060E6@cloudsoftcorp.com> X-Mailer: Apple Mail (2.3124) X-Legal-Virus-Advice: Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by Cloudsoft Corporation Limited in this regard and the recipient should carry out such virus and other checks as it considers appropriate. X-Legal-Confidentiality: This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. Cloudsoft Corporation Limited does not accept responsibility for changes made to this message after it was sent. X-Legal-Company-Info: Cloudsoft Corporation Limited. Registered in Scotland. Number: SC349230. Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP. archived-at: Tue, 05 Jul 2016 13:30:39 -0000 --Apple-Mail=_E3DB26DA-3518-4796-87BF-1FA8BB68A423 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 + 1 both for the longer term plan and the short term proposal =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94 Gnu PGP key - http://is.gd/TTTTuI > On 5 Jul 2016, at 13:56, Svetoslav Neykov = wrote: >=20 > Brooklyn has a number of places where it will try to load a class by = name. It's either using Class.forName(..) or at best = mgmt.getCatalogClassLoader().loadClass(...). This is highly likely to = fail when run in Karaf. > Some examples of this behaviour: > * configuring entitlements implementation in brooklyn.properties (or = configuring any other class name for that matter) > * initializers/enrichers in yaml > * objects passed as config keys/sensors to an entity, with the entity = not knowing how to load the classes - can't rebind. For example Brooklyn = DSL deferred objects / SpecialFlagsTransformer passed as config > * PolicyResource trying to attach a policy by class name >=20 > Longer term we should introduce bundle knowledge in all of those = places. There are various ways to do that - ether by explicitly passing = bundle symbolycName + version, loading through a catalog item or another = OSGi mechanism altogether. > Shorter term I suggest we go for the following workaround, giving us = time to introduce proper OSGi behaviour for each of the the above cases: > * Pull the class loading logic in a single place. Same as = ResourceUtils, but for classes. > * Support bundle symbolic name + version embedded in the class name - = for example = org.apache.brooklyn.policy:0.10.0.SNAPSHOT:org.apache.brooklyn.policy.ha.S= erviceFailureDetector. That will allow us to use the existing code paths = to pass classes, but be able to resolve them. > * Fall back to a white list of bundles to scan for the class name. = For example "org.apache.brooklyn.*:0.10.0.SNAPSHOT". This will help in = parsing existing yaml plans, using stock enrichers, rebinding. >=20 > Svet. --Apple-Mail=_E3DB26DA-3518-4796-87BF-1FA8BB68A423--