From commons-user-return-11505-apmail-jakarta-commons-user-archive=jakarta.apache.org@jakarta.apache.org Thu Apr 07 14:00:45 2005 Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 61197 invoked from network); 7 Apr 2005 14:00:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Apr 2005 14:00:45 -0000 Received: (qmail 84359 invoked by uid 500); 7 Apr 2005 14:00:35 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 84308 invoked by uid 500); 7 Apr 2005 14:00:35 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 84295 invoked by uid 99); 7 Apr 2005 14:00:35 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of mijimathews@gmail.com designates 64.233.170.199 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.199) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 07 Apr 2005 07:00:33 -0700 Received: by rproxy.gmail.com with SMTP id a41so450453rng for ; Thu, 07 Apr 2005 07:00:31 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=i4DuCpUE6pC+zp+wEwJO0v2btz3JStoY7eHFjrxgOyJWJkfNpuKYUH8K/UMctAbp56mga94dw5vJdlVRihb8iIgV3N2ySoy2AcQodImA9DlPrVNZMTCFzvAALCxcOwo0j4opMtqcyxZ14NcDFaJ+YV3KJbDPIrWH5W3FsD5yxn4= Received: by 10.38.153.43 with SMTP id a43mr432777rne; Thu, 07 Apr 2005 07:00:31 -0700 (PDT) Received: by 10.38.59.32 with HTTP; Thu, 7 Apr 2005 07:00:31 -0700 (PDT) Message-ID: Date: Thu, 7 Apr 2005 10:00:31 -0400 From: Miji Mathews Reply-To: Miji Mathews To: Jakarta Commons Users List Subject: Re: [Configuration] CompositeConfiguration - setting FileChangedReloadingStrategy on each XMLConfiguration In-Reply-To: <7DEAA1ADB60C8046BDBC04273BDFF89B4096BE@s-osl-23-0031.corp.4tel.no> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <7DEAA1ADB60C8046BDBC04273BDFF89B4096BE@s-osl-23-0031.corp.4tel.no> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ConfigurationFactory factory = new ConfigurationFactory("config.xml"); CompositeConfiguration cc = (CompositeConfiguration)factory.getConfiguration(); for (int i = 0; i < cc.getNumberOfConfigurations(); i++) { if (cc.getConfiguration(i) instanceof XMLConfiguration) { ((XMLConfiguration)cc.getConfiguration(i)).setReloadingStrategy(new FileChangedReloadingStrategy()); } } On Apr 7, 2005 8:54 AM, tore.larsen@edbtelesciences.com wrote: > > > Hei, > > I'm trying to use CompositeConfiguration to read the following configuration > file: > > > > > > > fileName="/locations.xml"/> > fileName="/calendar.xml"/> > > > > > Each of these xml-elements will result in an XMLConfiguration. The intent is > to make it possible > for customers to change an entry in the locations.xml file and have the new > configuration > reloaded. I know that a FileChangedReloadingStrategy may be set on each of > the XMLConfigurations > If they where separate, but how can I set this reloadingStrategy when the > factory makes a > CompositeConfiguration that contain the two XMLConfigurations. > > I have assumed that I have to use CompositeConfiguration i order to > automatically get the two > XMLConfigurations. > > I hope for a code example as an explaination. > > Regards from Tore Garder Larsen > Software Engineer > EDB Telecom AS > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org