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 78CBF2009D9 for ; Thu, 19 May 2016 13:33:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7744D160A04; Thu, 19 May 2016 11:33: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 977FC160A00 for ; Thu, 19 May 2016 13:33:37 +0200 (CEST) Received: (qmail 46507 invoked by uid 500); 19 May 2016 11:33: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 46495 invoked by uid 99); 19 May 2016 11:33:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 May 2016 11:33:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BCA27180361 for ; Thu, 19 May 2016 11:33:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=cloudsoftcorp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id l4drsbZfcPEJ for ; Thu, 19 May 2016 11:33:33 +0000 (UTC) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 845725F474 for ; Thu, 19 May 2016 11:33:33 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id i142so3636880wmf.0 for ; Thu, 19 May 2016 04:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudsoftcorp.com; s=google; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=qS9Qu+Dcx5JuurZs0d9gskoXOFYbLMALzJWDDu8nxtA=; b=BupTvxXfLKZ0Iu/JFKgg9KTxCaspSDkMtepOV+ct57CBU+S4jF0+8ZY0R6bGCyqtmi FnyOVQXYkhdKTrFxF/Sbqeg9aWtgQpFPdeaHGOlvyqTVD8/oK9FE7p1oPHo79Hlr8/4F t8/Om3/jg+LK2+M7uFbfR8oOcya8u9PgqzvVs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=qS9Qu+Dcx5JuurZs0d9gskoXOFYbLMALzJWDDu8nxtA=; b=bVN9D4XaUMBAZow+8ELUKOQvdT/WinZDkSB/CFFT4uTouK0Da1J1MkICjZ25851/nM B4GlkfvbzzRoM6Mncy0nDQkaHeKZghrD1NiwHQVzdQjVQdhnqBlXpHgQihpakQ0Y2ukH SeoGi5sLYBG3+Ec82zRtxTb9W5My/eg4kS4uiPzVjXTOd4b4ycccaz2U1HwsY5+mWsf2 sA65sq8mfIkccfLXeVeVJWY+jvJxQ4BkeEphnlW3BSuSI9deXuDE31dMYIz2RJQM0ZkK RQBI1uvnoQiqOC+J25dByWpb1EnVc5+PQxRpD/88y77/0Nxw9P4a1fD1kOyEfVVwSyJ6 uuyw== X-Gm-Message-State: AOPr4FVEEKBsjLbhny78PK+spCIJ/xuEqfZ8/KxrjXizkyTC71JnwefktbJN5NaaZo0wmJQKy5ZmhNS9DhHbH3T6TCzMDrym4PcX2FGgcoMyi3yhMDttfBzTT6zcET3fgkJvgQ== X-Received: by 10.194.141.46 with SMTP id rl14mr12801675wjb.111.1463657612349; Thu, 19 May 2016 04:33:32 -0700 (PDT) Received: from [192.168.0.101] (46-10-124-142.ip.btc-net.bg. [46.10.124.142]) by smtp.gmail.com with ESMTPSA id pm4sm13855003wjb.35.2016.05.19.04.33.31 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 04:33:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Renaming persisted classes From: Svetoslav Neykov In-Reply-To: Date: Thu, 19 May 2016 14:33:30 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <4354F44C-40F1-4059-A080-98CDB495F925@cloudsoftcorp.com> References: To: dev@brooklyn.apache.org X-Mailer: Apple Mail (2.3112) 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: Thu, 19 May 2016 11:33:38 -0000 For OSGi we will need to revisit the functionality to work across bundle = boundaries. Supposedly users starting with the OSGi-fied distribution = will have a clean slate, so don't need to worry about renamed classes, = at least for the first version. I can suggest another alternative for the standard (non-osgi) = distribution - using classloader.getResources() will return all = resources with the same name so no need to worry about overriding the = files from downstream projects. But even with the current approach we can have a predefined place to put = those files, not necessarily in a brooklyn prefixed folder. After all = ServiceLoader does exactly the same in a predefined location = (META-INF/services). Svet. On 19.05.2016 =D0=B3., at 13:52, Richard Downer = wrote: >=20 > I'm not sure I'm happy with the idea of many 3rd-party jars adding = stuff > into a Brooklyn-owned package. It doesn't rule out a couple of = 3rd-party > packages happening to choose the same name. I also think there might = be > issues with OSGi, as OSGi requires explicit declaration of packages, = but I > don't know enough about OSGi to know for sure. >=20 > Are there any other options for doing this? I'd suggest Java's > ServiceLoader facility, but that requires 3rd party packages writing a = Java > class. Any other ideas? >=20 > Richard. >=20 >=20 > On 19 May 2016 at 11:32, Martin Harris = > wrote: >=20 >> Hi Folks, >>=20 >> Just a quick heads-up about a PR I raised yesterday >> >>=20 >> When Brooklyn is rebinding from persisted state, it instantiates = classes >> (such as entities) based on the persisted fully-qualified classname. = This >> causes a problem if the name of the class, or its package changes, >> resulting in a ClassNotFoundException >>=20 >> To resolve this issue, Brooklyn maintains a list of classes that have = been >> renamed >> < >> = https://github.com/apache/brooklyn-server/blob/6efc98a6ac79ef009468f231c8a= 93814ff63c5d2/core/src/main/resources/org/apache/brooklyn/core/mgmt/persis= t/deserializingClassRenames.properties >>> . >> The problem is that there is no way for downstream projects to extend = this >> list without simply copying the list and ensuring the copy is closer = to the >> head of the classpath - which risks divergence of the files >>=20 >> PR 144 resolves = this >> issue by moving the file into a specific package, then during >> deserialisation it checks for any files in that package that end with >> .properties. It=E2=80=99s assumed that downstream projects will use a >> project-specific filename to prevent collisions >>=20 >> Cheers >> =E2=80=8B >> -- >> Martin Harris >> Lead Software Engineer >> Cloudsoft Corporation Ltd >> www.cloudsoftcorp.com >> Mobile: +44 (0)7989 047-855 >>=20