On 09/09/08 19:24, Rony G. Flatscher wrote:
Hi there,
while poking around a little bit I was wondering, how one could get at
the "Type[...]" information via Java that the Java proxy object reveals,
if asking it to render to a string.
E.g. in the following (interactive) session Java is used as the bridge
for the scripting language ooRexx; first a Desktop service object is
created and assigned to a variable "a", then its
"com.sun.star.frame.XDesktop" interface is assigned to variabel "b" and
from it the "com.sun.star.beans.XPropertySet" interface is assigned to
variable "c". Sending the "toString" message to all three proxy objects
displays them allowing to distinguish which interface type they represent.
In the example session below (please watch out for line-wraps) that
interface type is the last comma separated token in the form of
"Type[...interface_name...]".
Now the question: how can one get at exactly that piece of information
via Java at runtime?
You can't, easily. (Maybe you can via reflection). As of DEV300m31,
every Java proxy object must implement interface
com.sun.star.lib.uno.Proxy (see
jurt/com/sun/star/lib/uno/Proxy.java:1.4), and the two cases that do are
defined in
jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java:1.8 (for
the remote URP bridge), storing the relevant data as "private final Type
type;", and in
bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
(for the in-process JNI bridge), storing the relevant data as "protected
Type m_type;".
Besides, that a proxy handles only a single interface (plus parent
interfaces) of a UNO object is, of course, an implementation detail that
can always change.
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]