Hello Marcos,
If u r still following the thread, I need your suggestion. Currently I am working on caching of the config files(xml). Consider that my config file is of the following structure
<config>
<logging>
<channel>
<database>
<name>LogDB</name>
<table>logtable<table>
</database>
<flatfile>
<path>c:\log.txt<path>
</flatfile>
</channel>
</logging>
</config>
I want to load this config into the cache. Once done I should be able to acces the leaf nodes/values with ease, It should NOT be something like this
ConfigCache cc = CacheFactory.getConfigCache();
String logPath = cc.get("logging").get("channel").get("flatfile").get("path");
I WANT it to be something like this
ConfigCache cc = CacheFactory.getConfigCache();
String logPath = cc.get("loggingPath");
Though I use minimal method's to access the "path", internally in the cache, the hierarchy of the xml structure should be maintained.
How can this be done, in other words I want to map the XML structure with a suitable Key-Pair values (or some other structure). One option is to concatenate all the node names and use it as a key to retrieve the value, i.e,
String logPath = cc.get("loggingChannelflatfilePath");
But I feel that there can be better alternative to this.
Mohamed Zafer