Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 68181 invoked from network); 23 Dec 2008 02:18:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Dec 2008 02:18:48 -0000 Received: (qmail 87008 invoked by uid 500); 23 Dec 2008 02:18:46 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 86851 invoked by uid 500); 23 Dec 2008 02:18:46 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 86840 invoked by uid 99); 23 Dec 2008 02:18:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Dec 2008 18:18:46 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zhoukevin83@gmail.com designates 209.85.219.20 as permitted sender) Received: from [209.85.219.20] (HELO mail-ew0-f20.google.com) (209.85.219.20) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Dec 2008 02:18:39 +0000 Received: by ewy13 with SMTP id 13so2381622ewy.12 for ; Mon, 22 Dec 2008 18:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=weQUiE5pT+g69Ab2Yr3W/kXfgMqbwGHHKzA1eSM5ufc=; b=Qh3Z0ttBkW1yyhNav/jZuU5Tkd9iLhCeK6q/ZsgYDkckZWZx0TbYmI2+AM2Rs4bmtE B+kMWcX8kITUGUJqxXg2JmTMgoPNu2TUNndRSNYNYTVphrZSWvAGxcrqdP2jDj1ixV+g 0KgDtoyEu+/QonYAywOGPffa3IB9GkzJYiS7Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=I40SF1cjZ5dVMosL96MYV9mtj6kM0EDiVHax7R/xMQJFxuJdyVe4NvPlkzp+HihZa4 jSqg+UOnlwcQk7I520xoLsQy3DfCnfZOefH3CnC4cqRMc3/cVJDT/K13a8JfOpKnwZyW aJffB+Q9B+5J08a1HZFMqaSBrAbmwj3fqP3oA= Received: by 10.210.12.18 with SMTP id 18mr5995508ebl.130.1229998697946; Mon, 22 Dec 2008 18:18:17 -0800 (PST) Received: by 10.210.144.7 with HTTP; Mon, 22 Dec 2008 18:18:17 -0800 (PST) Message-ID: <70c713190812221818i43a079bdqaf782f4f770e8d3a@mail.gmail.com> Date: Tue, 23 Dec 2008 10:18:17 +0800 From: "Kevin Zhou" To: dev@harmony.apache.org Subject: Re: Using PriviAction instead of PrivilegedAction In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_81344_18213516.1229998697928" References: <70c713190812212002m55b534dbm4491148d1e3997cd@mail.gmail.com> <70c713190812212152q43f69c19y4d6c2f47a3a85fe4@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_81344_18213516.1229998697928 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Alexei wrote, > Could you please elaborate both variants a bit? Yes. PrivilegedAction is an interface which is used only for computations that do not throw checked exceptions. We also has a PriviAction implementation of PrivilegedAction interface. PriviAction is a helper class to avoid multiple anonymous inner class for doPriviledged/PrivilegedAction calls. > It is always a trade off between modularity and speed. :) Every time when you implement a doPriviledged/PrivilegedAction block, you need to add a anonymous inner class. PriviAction wraps some common doPriviledged/PrivilegedAction calls for system properties, security properties, security policy and so on. In a word, PriviAction can help to avoid multiple anonymous inner classes to make our code look better. > The performance measurement might be a part of Kevin's arguments. In fact, I don't know whether PriviAction may improve any performance. Only since we have such a PriviAction helper class, why not use it instead? ------=_Part_81344_18213516.1229998697928--