Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 22983 invoked from network); 7 Dec 2004 18:09:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Dec 2004 18:09:27 -0000 Received: (qmail 85784 invoked by uid 500); 7 Dec 2004 18:09:22 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 85718 invoked by uid 500); 7 Dec 2004 18:09:22 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 85705 invoked by uid 99); 7 Dec 2004 18:09:22 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mailout11.sul.t-online.com (HELO mailout11.sul.t-online.com) (194.25.134.85) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 07 Dec 2004 10:09:20 -0800 Received: from fwd02.aul.t-online.de by mailout11.sul.t-online.com with smtp id 1Cbjm2-00007p-02; Tue, 07 Dec 2004 19:09:18 +0100 Received: from [192.168.0.1] (Th8uGyZLYesry4nNhGTWC+i3a3Crxk42n+Bh7dStLvYKScOWOgnKEl@[217.236.187.89]) by fwd02.sul.t-online.com with esmtp id 1Cbjll-158gMK0; Tue, 7 Dec 2004 19:09:01 +0100 Message-ID: <41B5F1C9.6080704@t-online.de> Date: Tue, 07 Dec 2004 19:09:13 +0100 From: Oliver.Heger@t-online.de (Oliver Heger) User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [configuration] File locator References: <41B5E5E4.5080602@lfjr.net> In-Reply-To: <41B5E5E4.5080602@lfjr.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: Th8uGyZLYesry4nNhGTWC+i3a3Crxk42n+Bh7dStLvYKScOWOgnKEl X-TOI-MSGID: 1bdb5e68-ce8c-46a6-8ebe-f79260b892a6 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N If we have Loccators, IMO there is no need to keep the base path and file name stuff in file based configurations. These are things a concrete Locator has to deal with, and the information needed by a Locator may vary. So I suggest the following simple method signature: URL locate(); // eventuelly throws ConfigurationException? Concrete Locators should have getter and setter methods for the properties they need, e.g. the ClasspathLocator a resource name, the URLLocator a URL etc. That way a Locator could be created by Digester and initialized with a SetPropertiesRule, which comes in handy when used with ConfigurationFactory. Usage of a Locator would then look like: Locator locator = new MyConcreteLocator(); // init locator as necessary Configuration conf = new PropertiesConfiguration(locator); in contrast to Locator locator = new MyConcreteLocator(); Configuration conf = new PropertiesConfiguration(); conf.setBasePath(...); conf.setFileName(...); conf.load(locator); Oliver Emmanuel Bourg wrote: > Here is a quick attempt at implementing the Locator strategy discussed > earlier. Feel free to comment :) > > Emmanuel Bourg --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org