|
http://en.wikipedia.org/wiki/D-Bus D-Bus (Desktop Bus) is a simple inter-process communication (IPC) system for software applications to communicate with one another. D-Bus was heavily influenced by KDE2–3's DCOP system and has replaced it in the KDE 4 release; it is supported on Linux, Microsoft Windows and Apple Mac OS X operating systems and is used by Qt 4 and GNOME. In GNOME it has gradually replaced most parts of the earlier Bonobo mechanism. D-Bus is primarily developed by Red Hat, as part of the freedesktop.org project. Released under the terms of the GNU General Public License and the Academic Free License, D-Bus is free software.
[edit] DesignD-Bus allows programs to register with it in order to offer services. It also allows client programs to look up which services are available. Programs can also register as waiting for events of the kernel like hot swapping hardware. D-Bus is implemented as a daemon. Users can run several instances of it, each called a channel. There will usually be a privileged system channel, and a private instance for each logged in user. The private instances are required because the system channel has access restrictions. The main mission of the system channel is to deliver the signals from the HAL (hardware abstraction layer) daemon to the processes interested in them. The mission of the private instances is to provide unrestricted communication among any applications of the user. [edit] ArchitectureD-Bus has three architectural layers:[2]
D-Bus is designed for two specific cases:
[edit] MechanismsEach application using D-Bus contains objects that usually map to GObject, QObject, C++ objects, or Python objects. An object is an instance rather than a type. When messages are received over a D-Bus connection, they are sent to a specific object, not to the application as a whole. In this way, D-Bus resembles software componentry, as it appears to users as if they are interacting with an object across the IPC connection, whether or not there is an object on the other side. To allow messages to specify their destination object, there has to be a way to refer to an object. In many programming languages, this is usually called a pointer or reference. However, these references are implemented as memory addresses relative to the address space of the application, and thus can't be passed from one application to another. To solve this, D-Bus introduces a name for each object. The name looks like a filesystem path, for example an object could be named /org/kde/kspread/sheets/3/cells/4/5. Human-readable paths are preferred, but developers are free to create an object named /com/mycompany/c5yo817y0c1y1c5b if it makes sense for their application. The D-Bus objects' names are namespaced to ensure different code modules are kept separated. Namespaces are generally prefixed with the developer's domain name components (eg. /org/kde). [edit] References
[edit] External linksD-Bus at the Freedesktop.org home page |
