Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 87347 invoked from network); 9 Jan 2007 15:04:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jan 2007 15:04:04 -0000 Received: (qmail 52663 invoked by uid 500); 9 Jan 2007 15:04:08 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 52609 invoked by uid 500); 9 Jan 2007 15:04:08 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 52588 invoked by uid 99); 9 Jan 2007 15:04:08 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO [127.0.0.1]) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jan 2007 07:04:07 -0800 Message-ID: <45A3AF50.301@apache.org> Date: Tue, 09 Jan 2007 16:05:52 +0100 From: Carsten Ziegeler User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Bean overriding. References: <45A3A637.9080305@mobilebox.pl> <45A3AB59.1040108@apache.org> <45A3ABC2.6050108@mobilebox.pl> In-Reply-To: <45A3ABC2.6050108@mobilebox.pl> X-Enigmail-Version: 0.94.1.2 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Leszek Gawron wrote: > Carsten Ziegeler wrote: >> Leszek Gawron wrote: >>> One would like to provide a totally new implementation of core component >>> (i.e. store, continuations manager etc.). The current version of the >>> component will be loaded anyways (the bean definition resides somewhere >>> in cocoon-core.jar/META-INF/cocoon/spring/*.xml). Defining a new bean of >>> the same name will throw a nasty exception. What should the user do? >>> >> As far as I know, you'll not get an exception and the last definition is >> used. > > What is the 100% reliable way to make the definition I want the last one? > The configuration files are applied in alphabetical order, so the name of your configuration file should be after the name of the provided configuration. In addition, all configuration files from /WEB-INF/classes/META-INF/cocoon are applied after all configuration files from jars. So putting something here is the safest way! Btw, we should use a naming schema for our configuration files to provide a naming contract people can rely on when trying to override configurations (the contract could be as simple as to require that all file names start with "cocoon-". So anything after "c" can overwrite. Carsten -- Carsten Ziegeler - Chief Architect http://www.s-und-n.de http://www.osoco.org/weblogs/rael/