Registering java components |
As there are many ways to Rom, there many ways to register a component. But what all ways have in common, is that an ImplementationRegistration instance is needed.
So, a service can be registered via star basic creating the service ImplementationRegistration and calling the method registerImplementation.
Basic example:
regImpl = createUnoService("com.sun.star.registry.ImplementationRegistration") regImpl.registerImplementation("com.sun.star.loader.Java2", "file:///home/testComponent.jar", null) |
Another way is to use the binary UNO bound tool regcomp. This tool needs to create a java virtual machine, which it does by the service JavaVirtualMachine.
Binary exmaple (UNIX):
setenv OO_JAVA_PROPERTIES RuntimeLib=/usr/java1.2/jre/lib/sparc/native_threads/libjvm.so |
Unfortunatley this service JavaVirtualMachine often needs some hints, to find the java installation to use. To avoid this, there is another java based tool.
Java example:
java com.sun.star.tools.uno.RegComp applicat.rdb register file:///home/testComponent.jar com.sun.star.loader.Java2 |