Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5483191FE for ; Sat, 10 Nov 2012 05:49:41 +0000 (UTC) Received: (qmail 19304 invoked by uid 500); 10 Nov 2012 05:49:39 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 19053 invoked by uid 500); 10 Nov 2012 05:49:36 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 19002 invoked by uid 99); 10 Nov 2012 05:49:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Nov 2012 05:49:34 +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 (athena.apache.org: domain of trejkaz@trypticon.org designates 209.85.220.176 as permitted sender) Received: from [209.85.220.176] (HELO mail-vc0-f176.google.com) (209.85.220.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Nov 2012 05:49:28 +0000 Received: by mail-vc0-f176.google.com with SMTP id fo13so5483792vcb.35 for ; Fri, 09 Nov 2012 21:49:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=1bm9e5jV9eC4a92dH9u30LY+wgHJb5p2DzzceBLP0ik=; b=IbkfqLbKadyacs6KcNN/zB7ODlejwbO4iZRxD8ckdoUEEspLVxPtqmlUbExxudFJim ZkQ/oT0xl4GwFLV2HskQ9sTRSQfn1oUxnY7QPdmYN9+zroBv5Jb+o6w8tJgzYflJXHe7 /1wENug3SXPAtPJbZLphRdd+p/fLeCYn6IFzGg5tu2tIbc4FewYv09HdLTcWsPtJpXON Pp45DhMXpLu72Q9HxvROrofvq8Cl6eC+pNt0HoTnwJ5SCykyohATnYMwq4mVZ3neaaXE WTnyyMG/EI3DHOwMeOpfdxAbOr8tDTVS36WfJRIj4cLxTvUr7TbbsBSBKmDrMdVEvomP IMtQ== Received: by 10.52.64.166 with SMTP id p6mr12450908vds.9.1352526547295; Fri, 09 Nov 2012 21:49:07 -0800 (PST) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id w17sm716032vdf.16.2012.11.09.21.49.06 (version=SSLv3 cipher=OTHER); Fri, 09 Nov 2012 21:49:06 -0800 (PST) Received: by mail-vb0-f48.google.com with SMTP id e21so92650vbm.35 for ; Fri, 09 Nov 2012 21:49:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.179.2 with SMTP id dc2mr11842641vdc.50.1352526546032; Fri, 09 Nov 2012 21:49:06 -0800 (PST) Received: by 10.58.249.198 with HTTP; Fri, 9 Nov 2012 21:49:05 -0800 (PST) In-Reply-To: References: Date: Sat, 10 Nov 2012 16:49:05 +1100 Message-ID: Subject: Re: Can I still use SearcherManager in this situation? From: Trejkaz To: Lucene Users Mailing List Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlWZ+06L0qiBYKlAOOjF3NwaXUr+PpEThA8ab0bUbdm7Q/EWtmsdF6c/yDm+dQoFi68vpfY X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Nov 8, 2012 at 8:29 AM, Trejkaz wrote: > It's not only protected... but the class is final as well (the method > might as well be private so that it doesn't give a false sense of hope > that it can be overridden.) > > I might have to clone the whole class just to make the method public. What I have ended up doing is wrapping SearcherManager and putting in my own locking logic borrowed from Lucene 4. So when I call maybeRefresh(), I know only one thread is doing it, which means I know the refresh will occur before the method returns. This seems to work fine and avoids duplicating much code. Once we switch to Lucene 4, I can throw away my wrapper class as the method names match those of Lucene 4's SearcherManager. TX --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org