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.
ComponentImplementationName
ComponentImplementationName is the implementation name of the component,
e.g. MyFooServiceImpl.
LocationUrl
LocationUrl is a file name of a shared library or jar file.
ServiceName
You can also specify a ServiceName if your component is already
registered. This looks for any registered component implementation in
the registry.
Registries
The optional Registries (e.g. c:\myreg.rdb) are used by the
ServiceManager. The ro
ones are opened for reading only, a single rw
one will be opened for reading and writing. If the rw
one does not exist, then it may be created. Components may read and write
to store their persistent state.
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.
HostName
Specifying a host name might be necessary to distinguish the network
interface to be used, if a machine is part of two networks.
PipeName
Name of a named pipe.
Name
Identifier for demanded component instances.
--singleaccept
The uno starter will accept one connection, provide the component
instance and die.
--singleinstance
The uno starter will accept any number of connections, but will provide
the same single component instance any time instead of creating a new
instance for each connection.