For the sake of OO design expose a public method in the service that will have a wait block in it. All intrested parties call the method which is blocking let say service.waitTillAvailable(). When the service is available use a notify() to notify all the intrested parties that the service is available.This would be just another way to do it.-Vik-----Original Message-----
From: sarma sarraju [mailto:sarma_sarraju@yahoo.com]
Sent: Thursday, January 17, 2002 6:25 AM
To: ajug-members@ajug.org
Subject: Thread notificationHi all,
I am working on a scenario where in I create a new thread from the main class to invoke the services required to listen to requests from clients. In a perticular scenario a perticular method call inside the mainclass need to wait for the above mentioned service to start.
One solution that I implemented in having a static boolean flag. The method that starts up the services which is in a service class will update the flag when the process is complete . I create a separate thread which will go to sleep till the flag is true and executes the code when the service is up( flag is true).
Is there any better way of doing it that adheres to MVC patterns? My code needs to stick to MVC patterns.
Would appreciate any suggetions.
Thanks,
Mark
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.