I basically do the same thing you do, except that I subscribe to the ApplicationFinish event of the GApplication and set a private bool flag signaling that it's done. Then I just do something like
private bool m_AppFinished = false;
public void Start()
{
m_AppFinished = false;
...
app.ApplicationFinish += OnApplicationFinish;
app.Start();
if (!m_AppFinished)
{
Thread.Sleep(100);
}
return;
}
private void OnApplicationFinish(object sender, whatever the event args are)
{
m_AppFinished = true;
}
I know this is a kludge, and there is probably a better way. I think you may be able to use an AutoResetEvent, but I haven't done that yet.
HTH,
-Matt
On 9/17/06, Anastis Sourgoutsidis <[EMAIL PROTECTED]> wrote:
Hi,
is there a way to call the GApplication's Start() method synchronously?
i.e. blocking further execution until the GApplication finishes execution.
Currently I achieve this by using an busy wait, e.g.:
App.Start();
while (App.Running);
return ds; //some elements of the dataset ds are modified
//in the ApplicationFinish callback.
But it seems it doesn't work quite right, as sometimes the Running
property changes to false before the GApplicationFinish callback is
executed. This is especially true when the application is run in debug
mode and breakpoints are placed in the callback functions. Hence, the
dataset ds is returned before it can be processed by the
ApplicationFinish callback.
Any help will be greatly appreciated.
Regards
Anastis Sourgoutsidis
MSc Web Services Development
University of Teesside, UK
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
alchemi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alchemi-users
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ alchemi-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/alchemi-users
