Question Regarding Config file

Experts,
Can some one please tell me about config files.How to create them and where to place them and how to call them.I am planning to create a config file error handling.If any one has samples please share them.Thanks

Regards,
Saritha.

Saritha,

Please check this thread link,it helps
http://www.wmusers.com/wmusers/messages/117/42756.shtml

HTH,
RMG.

Thanks RMG

Saritha,

I read the thread pointed to, by RMG, his suggestion is useful… for the sake of alternatives, you can also use an XML to store your config. I usually prefer this! In order to read this config file, you may create a flow service (eg readConfig) comprising of pub.flow:getFile-> pub.xml:xmlStringToXMLNode-> pub.xml:xmlNodeToDocument, to read the contents of the config file into an IS Document (you will need to create an IS Doc corresponding to the config xml).

If the config parameters are read often, it will be a good idea to define readConfig as a startup service and add a step in that service to store the config IS Doc into a Data Store or create a static IData Object. Then create a wrapper java service around this that checks whether the config IS Doc is present in the memory (as a static object or in the Data Store), if yes, return the requested parameter from that memory object or else do a physical read and store the config as a memory object before returning the value of requested parameter.

HTH, Roh

Thanks Rohit, can you please share a sample errorhandling xml file

Sarita:

Do read Ray Moser’s excellent article: “Store Integration Properties in Configuration Files”:
http://www.wmusers.com/ezine/2002nov_rmoser_1.shtml

It has supporting code as well.

The repository is useful gives a unified view of it’s data to all machines in a cluster. Even if you don’t have a cluster now, this future-proofs your application.

A file-based repo (you can also have a DB-based repo) may have performance issues if data is accessed frequently. However, I store frequently accessed configuration data in a file-based repo with no problems by simply turning on caching in services that read the data.

Saritha,

What are your requirements related to errorHandling? The structure and the content of the file will be defined by your requirements. Besides, the contents of the (xml) config file don’t really matter as much as the process to read/load it and to fetch a value corresponding to a requested key.

Roh

Thanks every body,
I just need to see a sample error -report so that i create a template .Thanks alot.

Regards,
saritha