Return-Path: X-Original-To: apmail-river-dev-archive@www.apache.org Delivered-To: apmail-river-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 E5A91C2D3 for ; Tue, 11 Jun 2013 12:56:38 +0000 (UTC) Received: (qmail 73186 invoked by uid 500); 11 Jun 2013 12:56:38 -0000 Delivered-To: apmail-river-dev-archive@river.apache.org Received: (qmail 73070 invoked by uid 500); 11 Jun 2013 12:56:38 -0000 Mailing-List: contact dev-help@river.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@river.apache.org Delivered-To: mailing list dev@river.apache.org Received: (qmail 73060 invoked by uid 99); 11 Jun 2013 12:56:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 12:56:37 +0000 X-ASF-Spam-Status: No, hits=4.0 required=5.0 tests=HTML_MESSAGE,MISSING_MIMEOLE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [207.57.65.70] (HELO zeus.net.au) (207.57.65.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 12:56:30 +0000 Received: (qmail 49934 invoked by uid 16710); 11 Jun 2013 12:56:08 -0000 Received: from unknown (HELO [10.124.157.105]) ([49.176.72.175]) (envelope-sender ) by 207.57.65.70 (qmail-ldap-1.03) with SMTP for ; 11 Jun 2013 12:56:08 -0000 From: Peter Reply-To: Peter To: dev@river.apache.org Subject: Re: Immutable Entry X-Mailer: Modest 3.1 References: <1370953391.12414.11.camel@Nokia-N900-51-1> <1370953511.26113.170.camel@cameron> In-Reply-To: <1370953511.26113.170.camel@cameron> Content-Type: multipart/alternative; boundary="=-RQnqPlfnOskYDI3a8MBM" X-MSMail-Priority: Normal X-Priority: 3 Date: Tue, 11 Jun 2013 22:55:38 +1000 Message-Id: <1370955338.12414.41.camel@Nokia-N900-51-1> Mime-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --=-RQnqPlfnOskYDI3a8MBM Content-Type: text/plain; charset=utf-8 Content-ID: <1370955338.12414.38.camel@Nokia-N900-51-1> Content-Transfer-Encoding: 8bit Although a user dev could use final fields in their own Entry implementations and perhaps should even be encouraged to do so, an immutable Entry could be simply reconstructed with the modified state before being submitted back into a space. What appears to be one object has many copies across distributed nodes, one more local copy won't hurt. I'm thinking about a best practices web page for user devs. Regards, Peter. ----- Original message ----- > > On Tue, 2013-06-11 at 08:23, Peter wrote: > > I've been thinking about how Entry objects are immutable in serialized form > > and of course how they are not in unserialized form. > > > > Should Entry fields be final by default? > > > > No.  Javaspaces usage is frequently to take an entry, modify it and then > put it back into the space. > > Greg. > > > The JMM makes an exception for Serialization, allowing final fields to be > > frozen after construction during deserialization, provided it occurs before > > sharing with other threads. It would allow Entry's to be shared safely among > > threads, as long as their public fields aren't mutable, eg: an array. > > > > Regards, > > > > Peter. > --=-RQnqPlfnOskYDI3a8MBM--