Hello Christoph,

Hi Andreas,

I'm a colleague of Matthias and as he is not at office today, I will
give you some details about the required global event:

our component (let's call it A) processes TextDocuments. So it listens
for "OnNew"-Events and starts the asynchron processing of the
documents (in new Threads). This works fine, but now we need to
synchronize our component with an other component (let's call it B)
that does a similar job and requires the result of A.

We are now searching for a mechanism to broadcast a kind of
synchronization-event. This mechanism should of course be as most
independent of our custom component and as most integrable into the
generic OOo-Mechanisms. Using the globalEventBroadcaster is one
approach we have in mind, but there might still be other other ways.
We also considered implementing one of the XComponent- or
XEventBroadcaster-Interfaces but this seems to be a very
component-specific thing as the corresponding listener has to be
registered on exactly one specific object (our component A).

Broadcasting an event via GlobalEventBroadcaster seems to be a more
generic way as there is one central point for registering the
listener. To avoid the need of a complex naming-scheme for the
event-names, I would prefer a generic event like
"OnCustomProcessingFinished" (with an event-object containing
information about the custom component and the processed document).

I wouldnt say that the GlobalEventBroadcaster will be the right way doing such things. Its thought to broadcast document events and as you will see inside IDL description the notified event struct can contain the event name [string] and dthe document source [XModel] only. So it wont be possible to broadcast complex structures.

Further a new event "OnCustomProcessingFinished" will be not specific enough so it can be realy used by others. What should happen in case a further process (name it C) must be started after B was finished ... but not after A has done its work ? How do you implement an order here ?

Why you dont register on listener to the GlobalEventBroadcaster which starts A,B and further jobs in the right order if its time doing so ? You can use existing interfaces of OOo (implemented by your own) to build a "job queue". E.g. the set of interfaces around css.frame.XJob and friends can help you here.

regards,
Christoph

Best Regards
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to