Hi together,
recently I asked how to define a singleton in OOo. Now my singleton
works. It's purpose is to load the Spring Framework and to use it later.
Thus I defined an Interface with the needed methods:
-----%<-----
#ifndef __de_twc_oocom_comp_xspringloader_idl__
#define __de_twc_oocom_comp_xspringloader_idl__
#include <com/sun/star/uno/XWeak.idl>
module de { module twc { module oocom { module comp {
published interface XSpringLoader : com::sun::star::uno::XWeak {
any getSpring();
void setSpring([in] any spring);
};
}; }; }; };
#endif
-----%<-----
The implementation of these methods look like this:
-----%<-----
public Object getSpring() {
if(springInstance == null)
initSpring();
return (Object) springInstance;
}
public void setSpring(Object spring) {
if (spring instanceof IServiceFactory) {
springInstance = (IServiceFactory) spring;
}
}
-----%<-----
Initializing the Spring Framework works fine, but returning it failes
with the message:
-----%<-----
com.sun.star.uno.RuntimeException: [jni_uno bridge error] UNO calling
Java method getSpring: [map_to_uno():any] UNO type not found:
de.twc.service.ServiceFactory
-----%<-----
How can I solve this? Can I define my own return type? If I understood
the DevWiki correctly, this is not possible. Thus, how can I cast
springInstance to a "meta-object" and cast it back later?
Greetings, Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]