(incubating) | The Free and Open Productivity Suite
Announcing Apache OpenOffice 3.4

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 Feather

Copyright & License | Privacy | Contact Us

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

Apache OpenOffice is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.