Thanks Matthew..... I've tried it and Its working.... Thanks a lot for ur valuable suggestion......
~sekhar -----Original Message----- From: Matthew Carey [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 6:59 PM To: [email protected] Subject: Re: Initializing a web service before invoking its methods As a botch you could have a class that contains static data structures to hold your initialization data as well as a boolean that would hold whether it had been initialized. It might be better if the initialising bit were sychronised. That way if you wanted to read say a properties file only once you could do fill the static properties structure the first time the class was instantiated and subsequent times the class was instantiated the properties data would still be in memory so no need to read it in again. However you would want to be careful writing to this structure unless it was guarded to prevent interference and in locking your resources you had considered the possibility of deadlock. Matthew Phani Sekhar wrote: > Hi all, > > > > I want to write a web service that has to be initialized and configured > before doing its actual job. > > If we write the initialization code in the same method, it will end up > doing the same stuff for each and every request. > > Is there anything that we can do to avoid this and do the initialization > and configuration only for the first request???? > > Is there anything like init() method of Servlet with which we can > initialize the webservice on the first request ??? > > Please help. > > > > Thanks in Advance > > Phani Sekhar > > > > > --------------------------------------------------------------------- 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]
