0

So the DBus .service mechanism allows DBus to start a process if the requested service isn't running. I'm looking for something similar, but for objects.

If I have Object_0 thru Object_9 available, but only want to register them for DBus on-demand, i.e., when somebody requests the object. The path will be known, so I'm basically looking for a way to "catch" the error if it isn't registered and add the object (or provide an error, if for instance Object_11 is asked for) dynamically at run-time.

Is there a recommended way to do this? I have to think it has been done before, but I'm not finding anything.

Brett Stottlemyer
  • 2,734
  • 4
  • 26
  • 38
  • As far as I'm aware, this is not possible. I have seen something in the APIs before though, about providing fallbacks, though I have never used them so I don't know if that would do anything. Is there some specific problem that you're trying to solve here? – rm5248 Apr 01 '13 at 21:25
  • I'm just trying to do a lazy instantiation type thing. I was assuming this was a common enough desire to have a standard solution. So when I create a dbus proxy, it will trigger getting the object registered for that connection if it wasn't already. – Brett Stottlemyer Apr 02 '13 at 18:49
  • If you need/want to do lazy instantiation, what would probably work best in that case is to export something light onto the DBus on the correct path, and then do the heavyweight initialization once the method is called to replace what you have exported, i.e. proxy from the GoF book(Gamma et al) – rm5248 Apr 03 '13 at 15:23

0 Answers0