Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.11

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
setenv CLASSPATH $UDK/ridljar:$UDK/jurt.jar:$UDK/java_uno.jar
regcomp -register -br applicat.rdb -c file:///home/testComponent.jar -l com.sun.star.loader.Java2

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 

 

 

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.