commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miji Mathews <mijimath...@gmail.com>
Subject Re: [Configuration] CompositeConfiguration - setting FileChangedReloadingStrategy on each XMLConfiguration
Date Thu, 07 Apr 2005 14:00:31 GMT
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
<tore.larsen@edbtelesciences.com> wrote:
>  
> 
> Hei, 
> 
> I'm trying to use CompositeConfiguration to read the following configuration
> file: 
> 
> <file> 
>  
> 
> <?xml version="1.0" encoding="UTF-8"?> 
> <configuration> 
>   <xml
> fileName="<path-to-a-place-outside-war>/locations.xml"/> 
>   <xml
> fileName="<path-to-a-place-outside-war>/calendar.xml"/> 
> </configuration> 
> 
> </file> 
> 
> 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


Mime
View raw message