Hi Oscar,

Oscar Picasso wrote:

> Hi Mathias,
> 
>> 3- What is the "UNO service that can be called with an object receiving a
>> > callback"? Have you any pointer about it (documentation, sample code
>> etc.)?
>>
>> I'll dig that out.
>>
>>
> Thanks for your help.
> 
> As I need anyway to use a java client, this UNO service does not seem to
> help. I am still curious but I am starting another thread about how to use
> OO as a local server in most *reliable* way even if doing so implies that
> the client access the server in a single thread. 

Sorry, I forgot about your question. :-[

Working in the main thread of OOo will increase stability in every case.
Here's how to do it: use "com.sun.star.awt.AsyncCallback" service to get
a callback from the office main thread. You will need an own object
implementing the com::sun::star::awt::XCallback interface.
This object will be provided to the
om::sun::star::awt::XRequestCallback::addCallback() call.

How does it work?

When a remote application calls a UNO API method through the remote
bridge, a new thread is created in OOo that executes the API call. Both
threads (the thread on OOo side and the thread on remote side) are
assigned to each other. As now we have at least two threads running in
OOo that can call into the application code, race conditions caused by
some bugs here and there are possible.

If you use the AyncCallback service, it will call the remote application
from inside the main thread and this will create another thread on the
remote application side that is assigned to OOo's main thread. Every
call done in this thread will not create multi threading problems for
OOo's own processing.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to