Hello Andreas,
Andreas Schlüns wrote:
Hello Cornelis,
Hi,
When I connect to OpenOffice.org 2.4 RC1, with the Java UNO bridge
(Bootstrap.bootstrap()), I can get the XDesktop and store it in a
variable.
Now, I add a XTerminateListener to the desktop.
After that, I call XDesktop.terminate(). This returns true.
At the termination listener I see that queryTermination and
notifyTermination is called. So far so good. Openoffice is really
closed now, I do not see a process any more.
But the disposing(EventObject) is not called.
In OpenOffice.org 2.3 and lower, the disposing is called just before
OpenOffice dies. Is this a new behaviour or is this a bug?
The Desktop service is a special one ... it's designed and implemented
as a singleton instance. And those singeltons are disposed by the
context service manager directly. Might be here is the reason for the
new behaviour. Whats happen on shutdown ?
XDesktop.terminate()
-> calls XTerminateListener.queryTermination ()
-> calls XTerminateListener.notifyTermination ()
-> signals shutdown to process (asynchron !)
<- returns result (migtht be TRUE)
...
async shutdown will be initiated
-> UNO deinitialize
-> ServiceManager.dispose()
-> XDesktop.dispose()
-> XEventListener.dispose()
... bridge already closed ?
Now is the question: Can UNO report those notifications over bridges
even if it stands in its own deinitialization request ?
Might be deinitialization of UNO was changed last time ?
Stephan ... seams you know more about those details ?
Kind regards,
Cornelis Hoeflake
Regards
Andreas
We need to restart the office from our code, but the process will
deadlock when we bootstrap while another office process is terminating.
So we need a reliable way to determine wether the office is terminated.
By the disposing call, we could know that. Is there another way to
detect that?
If you call for example XDesktop.getCurrentFrame() just after you have
terminated it, the OpenOffice process and the Java process will hang.
The following workaround seems to work, but is dirty:
if (desktop.terminate()) {
while (true) {
try {
context.getServiceManager();
} catch (DisposedException e) {
break;
}
}
} else {
// could not terminate
}
Regards,
Cornelis
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]