Thanks Ralph
The idea is to create a custom Configuration named <remote> which can
load/update configuration files using REST service with some params such as
ETag, revision etc. as those features are not supported by standard API. You
right I've used DefaultConfigurationBuilder to load this file and registered
custom ConfigurationProvider to handle <remote> tag only:
//client
DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
builder.addConfigurationProvider("remote", new
RemoteConfigurationProvider());
//internals
public class RemoteConfigurationProvider extends ConfigurationProvider {
@Override
public Object createBean(Class beanClass, BeanDeclaration data,
Object parameter) throws Exception {
//this code throws exception because a few <conf> tags defined
data.getNestedBeanDeclarations().get("configs").getNestedBeanDeclarations();
...
}
}
2010/1/21 Ralph Goers <[email protected]>
> I'm having trouble figuring out what you are trying to do. Is this the
> configuration file you are feeding to DefaultConfigurationBuilder or
> something else? The syntax below doesn't seem to match what
> DefaultConfigurationBuilder would expect and I'm not sure why you aren't
> just using that since as far as I can tell it supports what you are trying
> to do without you writing any custom code.
>
> Ralph
>
> On Jan 21, 2010, at 12:57 AM, Maxim Ulanovskiy wrote:
>
> > Hello,
> > I need to extend XML configuration definition to have something like:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <configuration>
> > <additional>
> > <remote server="http://configserver/config/" refreshDelay="5000">
> > <configs>
> > <conf>testCfg1.cfg</conf>
> > <conf>testCfg2.xml</conf>
> > </configs>
> > </remote>
> > </additional>
> > </configuration>
> >
> > To parse "remote" element I've defined custom ConfigurationProvider, but
> it
> > fails because of there are a few <conf> tags and the framework holds them
> as
> > NestedBeanDeclarations that should be unique. How can I resolve this
> issue?
> >
> > --
> > Best Regards,
> > Maxim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Best Regards,
Maxim