List Info

Thread: Re: problem removing XDispatchProviderInterceptor ...




Re: problem removing XDispatchProviderInterceptor ...
user name
2007-07-31 09:25:21
Hello Oliver,

I had a look on your example (because dispatch interception
is more my 
area then Carsten ones).

One question ... is the demo you sent the real application
or a demo only ?

The problem is that your main() method does the following
one:

a) bootstrap an office
b) retrieving the UNO context from the office
c) retrieving important UNO services
    (a'la Desktop, CurrentComponent etcpp)
d) register the dispatch interceptor
e) disable all macro-commands by returning NULL inside
queryDispatch()
f) leaving main
g) terminating the JVM !

And thats exactly your problem. Nobody hold the client
process alive.
So you register some UNO listener inside the office,
shutdown the JVM 
and all these listener are dead.

Solution:
Please make sure your demo application will wait for an
event which 
indicates that all processes are finished. Or better: write
an AddOn 
instead of a client application. Such AddOn is used inside
the office 
process and lives till all UNO-Java objects are gone or the
office 
process will be terminated explicitly.

Best Regards
Andreas

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: problem removing XDispatchProviderInterceptor ...
user name
2007-07-31 10:39:42
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Andreas,

> One question ... is the demo you sent the real
application or a demo only ?

no, it's only a part of my addon, i use the remote
connection
sometimes for debugging purpose ...

> g) terminating the JVM !
> And thats exactly your problem. Nobody hold the client
process alive.
> So you register some UNO listener inside the office,
shutdown the JVM
> and all these listener are dead.

I just tried it with my addon again, and got the same result
as before:

register Interceptor ....
setMasterDispatchProvider()
setSlaveDispatchProvider()

- -> all macro:/// cmd's are disabled now ...

i change to a different sheet, where my cmd's should be
enabled
(XActivationEventListener) ...

now i see:

unregisterInterceptor ....
getSlaveDispatchProvider()
getMasterDispatchProvider()
setSlaveDispatchProvider()
setMasterDispatchProvider(

but all macro:/// cmd's stay disabled... 
at this time and after the addon is still running ...

I try to send you a demo addon, but this will take some time
...
using oo 2.2.1 with vista business ...

thanks

Oliver

- --

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C
AB40 CFD0 4A45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFGr1e+TiyrQM/QSkURApQhAKCk/l1kBlzgY5dE9q9vPYKJ/xsycwCg
iQXA
qdbdzg5dQmz6GJhQaQkBxQI=
=Ptej
-----END PGP SIGNATURE-----

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )