Running Components - uno.exe

The UNO-starter is for running a component or service process, providing a runtime environment. Raising a component might look like this

[c:\] uno.exe -c MyComponent -l mycomp.dll -r myregistry.rdb -- foo bar

or

[c:\] uno.exe -s foo.bar.FooBarService -r myregistry.rdb -- foo bar

The starter loads the component and instanciates it. The component must export the interface com.sun.star.lang.XMain:

interface XMain : com::sun::star::uno::XInterface
{
    /** This method is called to run the component.
        <BR>
        @param aArguments command line arguments
        @return process error code to be returned to system
    */
    long run( [in] sequence< string > arguments );
};

Method run() will be called and returns the error code given back to the system. If the uno starter is executed with the -u (URL) option, then XInitialization is used instead of XMain. The -u option is described later.

Command line parameters:

uno (-c ComponentImplementationName -l LocationUrl | -s ServiceName)
[-ro ReadOnlyRegistry1] [-ro ReadOnlyRegistry2] ... [-rw ReadWriteRegistry]
[-u uno:(socket[,host=HostName][,port=nnn]|pipe[,name=PipeName]);iiop|urp;Name
[--singleaccept] [--singleinstance]]
[-- Argument1 Argument2 ...]

You can either specifiy a component implementation name and a component location url (e.g. a shared library or jar file) or you specifiy a service name of a registered service.

The -u (URL) option provides the opportunity to accept incoming connections and distribute component instances to other processes. Clients resolve outer process objects using the com.sun.star.connection.UnoUrlResolver service with this url. The starter accepts incoming client connections of the clients' com.sun.star.connection.UrlResolver service and provides the desired instance.
Component instances started via -u are not run using the XMain interface, they are initialized via the XInitialization interface, given the command line params.

Service com.sun.star.bridge.UnoUrlResolver

You can easily connect to a server started with the -u (url) option by using this service giving the same url to resolve. The service provides you an instance from remote.

Legal Notices