You can avoid these problems, if you write your protocol handler as a multi-instance service."
So how can I write a multi-instance service ?
I you wish to access your "server" everytimes a menu / toolbar item is clicked ... you have to implement your ProtocolHandler / Job as singleton.
I need to access my "server" from the menu/toolbar as well as through the ooimpress slide, it'll probably be some button placed on every slide on which click event I want to contact the server. So would it work for both cases ? On 11/9/06, Andreas Schlüns <[EMAIL PROTECTED]> wrote:
Hello Tabish, >> Solution: implement an asynchronous job (where the job execution service >> make sure that OOo doesnt terminate) ... or register a listener inside >> OOo to be notified in case the frame or the whole office will be closed. > > If I use asynchronous job can I reference my Server class and call > functions > on it from within openoffice ? I you wish to access your "server" everytimes a menu / toolbar item is clicked ... you have to implement your ProtocolHandler / Job as singleton. Means: every UNO service manager createInstance() call will return the same object - the same reference. So every dispatch() request will reach the same service instance. But then you will have the problems as described inside the DevelopersGuide. You has to deal with several initialization calls; several environments. Please look here: "http://api.openoffice.org/docs/DevelopersGuide/Components/Components#1_2_1_11_Singleton " Regards Andreas --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
