English:

The Free and Open Productivity Suite
New: Apache OpenOffice 4.1.1 released!

The Java Uno Application (UnoApp)

The generic java UNO application eleminates the need to write java UNO applications. It allows to instance any java UNO or binary UNO service, it is reachable via java class or an applicat.rdb. Even more advanced scenarios with exported or imported objects are possible. The UnoApp is the java counterpart to the uno executable used for binary UNO. Before executing UnoApp the Java archive files jut.jar, sandbox.jar, ridl.jar and jurt.jar should be available in the class path.

For example, to instantiate a ServiceManager only the service name has to be given:

java com.sun.star.tools.uno.UnoApp -s com.sun.star.lang.ServiceManager

Slightly more complicate is the import of an OO service manager:

java com.sun.star.tools.uno.UnoApp 
     -u "uno:socket,host=myhost,port=5678;urp;StarOffice.ServiceManager"

The Instance Inspector could be instantiated as follows (Windows):

java com.sun.star.tools.uno.UnoApp 
     -smgr -c\ InstanceInspector 
     -s com.sun.star.beans.InstanceInspector 
     -- -u\ uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager

In general the parameters are the following, a service manager to use, a service name or an import clause and optional arguments for the service which are passed via XInitialization. From this it follows that the service should implement the method initialize with all planned arguments.

UnoApp can be called with different options:

usage: UnoApp [option]*

Option Description
-c creates a XMultiServiceFactory out of the given component (via url or as classname, e.g. -c InstanceInspector)
--singleaccept if the object is to be exported, only export it once
-u import an object via the given url (e.g. -u uno:socket,host=localhost,port=2343;urp;StarOffice.ServiceManager)
-s the service to instantiate (e.g. -s com.sun.star.beans.InstanceInspector)
-r create a XMultiServiceFactory out of the registry file (e.g. -r applicat.rdb)
-- objects given to this option are passed via XInitialization to the result object (e.g. -- -u\ uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager)
-tr create a XMultiServiceFactory out of two registry files (e.g. -tr applicat.rdb user.rdb
-h shows all options with description
-smgr "object[,object]*" merges the given factorys into the result object factory










Apache Software Foundation

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

Apache, the Apache feather logo, and OpenOffice 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.