Activation: Service providers providing more than one service

Mikael Hallendal micke@imendio.com
Fri, 09 Jan 2004 17:24:51 +0100


Hi!

Trying to figure out the best way of solving when several services are
handled by the same binary. For example a binary that has two services A
and B, a client activates Service A but before the provider has
registered Service B another client tries to activate it. To avoid
having two binaries spawned the bus needs to be aware that these two are
both handled by the same binary.

This can be done in two ways. 

1) Match on the exec: The bus sees that Service B is handled by the same
   exec and doesn't try to executes it again but just puts the caller in
   the pending activation queue. Each service has it's own .service file
   which points to the same binary.

2) Have a service provider that can provide several services: For 
   example a .service file would contain information about all the
   services a certain service provider provides, example:

<serviceprovider name="org.gnome.Foo">
  <exec>/opt/gnome2/libexec/foo-d</exec>
  <service name="org.gnome.Foo.ServiceA"/>
  <service name="org.gnome.Foo.ServiceB"/>
</serviceprovider>

  The bus can then see that when someone tries to activate 
  org.gnome.Foo.ServiceB while it is still activating service provider
  org.gnome.Foo it should wait until the service provider is activated.

Any suggestions?

Regards,
  Mikael Hallendal
-- 
Mikael Hallendal               micke@imendio.com
Imendio HB                     http://www.imendio.com
Phone: +46 (0)709 718 918