Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0440C91ED for ; Wed, 18 Apr 2012 07:07:33 +0000 (UTC) Received: (qmail 1707 invoked by uid 500); 18 Apr 2012 07:07:27 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 1260 invoked by uid 500); 18 Apr 2012 07:07:12 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 805 invoked by uid 99); 18 Apr 2012 07:07:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 07:07:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jukka.zitting@gmail.com designates 74.125.82.170 as permitted sender) Received: from [74.125.82.170] (HELO mail-we0-f170.google.com) (74.125.82.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 07:07:00 +0000 Received: by werh12 with SMTP id h12so9626120wer.1 for ; Wed, 18 Apr 2012 00:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=quo7ZWBaLGKn24pK9T8vkVNWNaBTT/ZjCi6BSriTs5U=; b=O4r1z9Ux3BYEYRfxFLt92/J0bi3mANn8iV2TtrYY6TYz325kzI0GVBE36N3D0ms4r+ 87qgmPGJhi3gwsFdrLToio5XFxCRJqkxhBV0tYBM+NYXWFR4hgU8wz9bZXHQQHE1+/PE KowMrML6j9PYMoprrsyM2tWj2glI/ETHJDq8ZPdnETzzcUd33TXy83FdAWweOzDV0/24 9T1YIME4ctlll4LTJPYl85Z0R9KVWdKYoqd15qKlpeKXmIznoyLu15OxHMcdMkkxh8G+ mfBVyho41T3QidKVVQQnHTTPpfRjBcNOYQdEf3h78M2Hn6Hovb/f530+MGAQdw+9uCWI Ztkg== Received: by 10.180.85.69 with SMTP id f5mr3364175wiz.18.1334732800443; Wed, 18 Apr 2012 00:06:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.146.133 with HTTP; Wed, 18 Apr 2012 00:06:20 -0700 (PDT) In-Reply-To: <09021F9D-3C26-4C2F-989C-7F0DD8ADD229@adobe.com> References: <09021F9D-3C26-4C2F-989C-7F0DD8ADD229@adobe.com> From: Jukka Zitting Date: Wed, 18 Apr 2012 09:06:20 +0200 Message-ID: Subject: Re: Oak API - a top down look To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, On Wed, Apr 18, 2012 at 8:51 AM, Felix Meschberger wro= te: > IIUIC there is no notion of a workspace here, right ? So to implement JCR= workspaces, > those might be to top level ContentTree below the root ? We can handle this in two ways: 1. Specify the workspace name as a parameter to either login() or getCurrentContentTree(). 2. Have the root ContentTree represent the entire repository with workspaces below it as subtrees. Personally I'd prefer option 2 since it makes it much easier to handle cross-workspace operations, but there are complications with login() that's in Jackrabbit 2 more or less workspace-specific. >> All `ContentRepository` and `ContentSession` instances are thread-safe. >> ... >> `ContentTree` instances are *not* thread-safe... > > I think it is a good thing to clearly state thread-safe-ness. But I am wo= rried > about ContentTree not being thread-safe.. By declaring as not thread-safe, we avoid having to worry about synchronization and concurrent access in a lot of fairly complicated bits of code (refresh, commit, etc.). And since a client can easily acquire any number of parallel ContentTree instances, ensuring thread-safety shouldn't be a problem for the client. >> =A0 =A0ContentTree tree =3D ...; >> =A0 =A0ContentTree subtree =3D tree.addSubtree("hello"); >> =A0 =A0subtree.setProperty("message", "Hello, World!"); >> =A0 =A0tree.commit(); > > Particularly this one worries me most: We are now leaving the turf of imm= utable value > objects again and enter concurrency problem prone terrain ... As mentioned above, these trees are only mutable by the client, so there's no need to worry about concurrent changes from elsewhere. So for example traversing through the content tree will never encounter concurrent changes unless the client itself modifies things. And the underlying content model at the MicroKernel level is still fully immutable. BR, Jukka Zitting