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, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> 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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to